简体   繁体   English

无法解析 Android 应用模块的 Gradle 配置

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

I wanna use firebase database but when I clicked on "Connect to firebase" button, I got this problem.... can anyone help me???我想使用 firebase 数据库,但是当我点击“连接到 firebase”按钮时,我遇到了这个问题......谁能帮帮我???

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

This problem is connected with one or more of your plugins.此问题与您的一个或多个插件有关。

Paste this:粘贴这个:

android.debug.obsoleteApi=true

to your gradle.properties file.到您的 gradle.properties 文件。

Now make rebuld.现在使 rebuld。 You must see a stacktrace with the problem plugin.您必须看到带有问题插件的堆栈跟踪。 Switch off this plugin, sync and try to connect to Firebase again - must be success now.关闭此插件,同步并尝试再次连接到 Firebase - 现在必须成功。

After successful connection to Firebase you can return your plugins, remove that line from the gradle.properties file and resync.成功连接到 Firebase 后,您可以返回您的插件,从 gradle.properties 文件中删除该行并重新同步。 Warning will appear again, but it is not important, because Firebase has configured already.警告会再次出现,但这并不重要,因为 Firebase 已经配置好了。

PS In my case I had 2 problem plugins: Sceneform and Crashlytics. PS 就我而言,我有 2 个有问题的插件:Sceneform 和 Crashlytics。

I was also having same problem but I Found The Solution Then To Solve This problem我也遇到了同样的问题,但我找到了解决方案然后解决了这个问题

  • Go To Gradle Scripts Folder转到 Gradle 脚本文件夹
  • Then open build.gradle(Project)然后打开 build.gradle(Project)
  • Remove the line - "jcenter() // Warning: this repository is going to shut down soon"删除该行 - “jcenter() // 警告:此存储库即将关闭”
  • Click on Connect to Firebase点击连接到 Firebase
  • It may ask to build so build the project它可能会要求构建所以构建项目
  • Then again click on Connect to Firebase然后再次点击连接到 Firebase
  • The you will be success full to open it打开它你会成功的

My case was in the dependencies of build.gradle(:app) it fixed when I tested commenting the line我的案例是build.gradle(:app)的依赖关系,当我测试评论该行时它已修复

testImplementation 'junit:junit:5'

I faced similar issue and found the following entry in my project's build.gradle to be the source of issue:我遇到了类似的问题,并在我的项目的 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 https://code.luasoftware.com/tutorials/android/how-to-add-firebase-to-android/#gradle-config-parsing-error

Another possibility is that gzips in your project might be the culprits.另一种可能性是项目中的 gzip 可能是罪魁祸首。 Search it up within your project folder and delete them, let gradle re-sync it for you.在您的项目文件夹中搜索并删除它们,让 gradle 为您重新同步它。

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

The way I fixed it was to comment out Fabric plugin ( apply plugin: 'io.fabric' ) from the app level build.gradle.我修复它的方法是从应用程序级别 build.gradle 注释掉Fabric插件( apply plugin: 'io.fabric' )。 Then, connect to firebase using the Firebase assistant.然后,使用 Firebase 助手连接到 firebase。 After connection is successful, you can uncomment the fabric plugin.连接成功后,可以取消对fabric插件的注释。

It's quite simple in my case.就我而言,这很简单。 I'd just changed my compileSdk 32 to compileSdk 31 in build.gradle.我刚刚在 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.

相关问题 错误:无法解析 Android 应用程序模块的 Gradle 配置 - Error: Could not parse the Android application Module's Gradle Config 错误:无法解析 Android 应用程序模块的 Gradle 配置。 解析或重新同步(构建 gradle 应用程序中没有存储库) - Error: Could not parse the Android application Module's Gradle Config. Resolve or resync (no repositories in build gradle app) 无法解析 Android 应用模块的 Gradle 配置,连接到 Firebase 时 - Could not parse the Android Application Module's Gradle config ,While connecting to Firebase Android Studio的项目gradle文件改了? - Android Studio's project gradle file changed? Android Studio 构建错误:Gradle - 找不到平台('com.google.firebase:firebase-bom:30.3.1') - Android Studio build error: Gradle - Could not find platform('com.google.firebase:firebase-bom:30.3.1') AWS:找不到配置文件 (MyName) - AWS : The config profile (MyName) could not be found Android Gradle 库冲突 - Android Gradle Libraries Conflict 安装没有成功。 无法安装应用程序:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED 安装失败,原因是:'null' - Installation did not succeed. The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED Installation failed due to: 'null' 找不到模块 workspace/server.js - could not find module workspace/server.js 无法将请求正文解析为 json:无法识别的令牌 - Could not parse request body into json: Unrecognized token
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM