【问题标题】:In android/app/build.gradle - following errors occur: following errors occur, following errors occur, following errors occur! How to fix?在 android/app/build.gradle - 发生以下错误:发生以下错误,发生以下错误,发生以下错误!怎么修?
【发布时间】:2019-09-06 12:40:18
【问题描述】:

我正在开发应用程序flutter,但是我所有的项目都出现了错误,即使我刚刚开始,错误已经存在,它们不影响编译但我担心它们是未来的问题! 谁能帮我改正?

    def localProperties = new **Properties**()
    def localPropertiesFile = rootProject.file('local.properties')
        if (localPropertiesFile.exists()) {
            localPropertiesFile.withReader('UTF-8') { reader ->
            localProperties.load(reader)
       }
   }

   def flutterRoot = localProperties.getProperty('flutter.sdk')
    if (flutterRoot == null) {
       throw new **GradleException**("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
   }

   def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
   flutterVersionCode = '3001'


    def flutterVersionName = localProperties.getProperty('flutter.versionName')
    flutterVersionName = '0.0.3'


    def keystoreProperties = new **Properties**()
    def keystorePropertiesFile = rootProject.file('key.properties')
     if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new **FileInputStream**(keystorePropertiesFile))
    }

【问题讨论】:

    标签: flutter dart flutter-plugin


    【解决方案1】:

    这些不是实际的错误,目前您正在 Flutter 中打开这些文件,因此您会看到错误。

    你需要做的就是打开build.gradle(app),在你的IDE右上角你应该会看到类似的东西:

    在 Android Studio 中将其作为 android 模块启动后,您会看到错误消失了!

    【讨论】:

    • 非常感谢您的硬化症!我是 Flutter 开发的新手……
    猜你喜欢
    • 2020-01-01
    • 1970-01-01
    • 2019-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-19
    • 1970-01-01
    相关资源
    最近更新 更多