【问题标题】:Could not parse the Android Application Module's Gradle config无法解析 Android 应用程序模块的 Gradle 配置
【发布时间】:2018-05-05 16:33:02
【问题描述】:

我想使用 firebase 数据库,但是当我点击“连接到 firebase”按钮时,我遇到了这个问题...... 谁能帮帮我???

Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync.

【问题讨论】:

标签: android firebase google-play-services


【解决方案1】:

此问题与您的一个或多个插件有关。

粘贴这个:

android.debug.obsoleteApi=true

到你的 gradle.properties 文件。

现在反抗。您必须看到问题插件的堆栈跟踪。 关闭此插件,同步并尝试再次连接到 Firebase - 现在必须成功。

成功连接到 Firebase 后,您可以返回插件,从 gradle.properties 文件中删除该行并重新同步。警告会再次出现,但并不重要,因为 Firebase 已经配置好了。

附:就我而言,我有 2 个有问题的插件:Sceneform 和 Crashlytics。

【讨论】:

    【解决方案2】:

    我也遇到了同样的问题,但后来我找到了解决方案 解决这个问题

    • 转到 Gradle 脚本文件夹
    • 然后打开 build.gradle(Project)
    • 删除行 - “jcenter() // 警告:此存储库即将关闭”
    • 点击连接到 Firebase
    • 它可能会要求构建所以构建项目
    • 然后再次点击连接到 Firebase
    • 您将成功打开它

    【讨论】:

      【解决方案3】:

      就我而言,这很简单。我刚刚将 build.gradle 中的 compileSdk 32 更改为 compileSdk 31。

      android {
          compileSdk 31
      
          defaultConfig {
              applicationId "com.example.grocerystore"
              minSdk 21
              targetSdk 32
              versionCode 1
              versionName "1.0"
      
              testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
          }
      }
      

      【讨论】:

        【解决方案4】:

        我遇到了类似的问题,并在我的项目的 build.gradle 中发现以下条目是问题的根源:

        compile 'com.google.api-client:google-api-client:1.22.0'
        compile 'com.google.http-client:google-http-client-gson:1.22.0'
        

        https://code.luasoftware.com/tutorials/android/how-to-add-firebase-to-android/#gradle-config-parsing-error

        另一种可能性是您项目中的 gzip 可能是罪魁祸首。在您的项目文件夹中搜索并删除它们,让 gradle 为您重新同步它。

        可能的替代解决方案:https://github.com/socketio/engine.io-client-java/issues/13https://github.com/ACRA/acra/issues/159

        【讨论】:

        • 我都试过了,但问题没有解决!!
        • “gzips”到底是什么??
        • 这个文件“google-services.json”可能是罪魁祸首吗??
        • gzip 是压缩格式,即扩展名为 .gz 的文件,请通过将 com.google.gms:google-services 更新到最新版本再试一次。
        【解决方案5】:

        我修复它的方法是从应用级别 build.gradle 中注释掉 Fabric 插件 (apply plugin: 'io.fabric')。然后,使用 Firebase 助手连接到 Firebase。连接成功后,可以取消对fabric插件的注释。

        【讨论】:

          【解决方案6】:

          我的情况是在 build.gradle(:app) 的依赖项中 当我测试评论该行时它已修复

          testImplementation 'junit:junit:5'
          

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2022-07-17
            • 2021-11-01
            • 2017-12-29
            • 2022-09-23
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多