簡體   English   中英

無法解析 Android 應用模塊的 Gradle 配置

[英]Could not parse the Android Application Module's Gradle config

我想使用 firebase 數據庫,但是當我點擊“連接到 firebase”按鈕時,我遇到了這個問題......誰能幫幫我???

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

此問題與您的一個或多個插件有關。

粘貼這個:

android.debug.obsoleteApi=true

到您的 gradle.properties 文件。

現在使 rebuld。 您必須看到帶有問題插件的堆棧跟蹤。 關閉此插件,同步並嘗試再次連接到 Firebase - 現在必須成功。

成功連接到 Firebase 后,您可以返回您的插件,從 gradle.properties 文件中刪除該行並重新同步。 警告會再次出現,但這並不重要,因為 Firebase 已經配置好了。

PS 就我而言,我有 2 個有問題的插件:Sceneform 和 Crashlytics。

我也遇到了同樣的問題,但我找到了解決方案然后解決了這個問題

  • 轉到 Gradle 腳本文件夾
  • 然后打開 build.gradle(Project)
  • 刪除該行 - “jcenter() // 警告:此存儲庫即將關閉”
  • 點擊連接到 Firebase
  • 它可能會要求構建所以構建項目
  • 然后再次點擊連接到 Firebase
  • 打開它你會成功的

我的案例是build.gradle(:app)的依賴關系,當我測試評論該行時它已修復

testImplementation 'junit:junit:5'

我遇到了類似的問題,並在我的項目的 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/13 https://github.com/ACRA/acra/issues/159

我修復它的方法是從應用程序級別 build.gradle 注釋掉Fabric插件( apply plugin: 'io.fabric' )。 然后,使用 Firebase 助手連接到 firebase。 連接成功后,可以取消對fabric插件的注釋。

就我而言,這很簡單。 我剛剛在 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"
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM