在android / app / build.gradle中-发生以下错误:发生以下错误,发生以下错误,发生以下错误!怎么修?

时间:2019-09-06 12:40:18

标签: flutter dart flutter-plugin

我正在开发应用程序,但是在我所有的项目中都发生了错误,即使我刚刚开始,该错误已经存在,它们不会影响编译,但是恐怕它们是将来的问题! 有人可以帮我纠正吗?

    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))
    }

1 个答案:

答案 0 :(得分:0)

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

您需要做的就是打开build.gradle(app),并且在IDE的右上角,您应该看到类似以下内容:

enter image description here

一旦在Android Studio中将其作为android模块启动,就会发现错误消失了!