英文:
"Could not parse Android Application Module's Gradle config" in Android Studio? error
问题
I am developing jetpack compose android application using firebase but when I run project I am getting following exception
Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync
I followed this answer link but it did not solve my problem
below my app.gradle file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.gms.google-services'
}
android {
compileSdk 33
defaultConfig {
applicationId "com.example.firebasegooglesignjetpackcompose"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.3'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
buildToolsVersion '33.0.0'
ndkVersion '33.0.0'
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
implementation 'androidx.compose.material:material:1.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-auth-ktx:21.3.0'
implementation 'com.google.android.gms:play-services-auth:20.5.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.0"
implementation "androidx.lifecycle:lifecycle-runtime-compose:2.6.0"
implementation "androidx.navigation:navigation-compose:2.5.3"
implementation "io.coil-kt:coil-compose:2.2.2"
}
below build.gradle
buildscript {
ext {
compose_ui_version = '1.4.0'
}
dependencies {
classpath 'com.google.gms:google-services:4.3.15'
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'com.google.gms.google-services' version '4.3.15' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I want to know where I am making mistake I am using android studio bumbble version
<details>
<summary>英文:</summary>
I am developing jetpack compose android application using firebase but when I run project I am getting following exception
Could not parse the Android Application Module's Gradle config. Resolve gradle build issues and/or resync
I followed this answer https://stackoverflow.com/questions/70883309/android-studios-project-gradle-file-changed but it did not solve my problem
below my app.gradle file
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.gms.google-services'
}
android {
compileSdk 33
defaultConfig {
applicationId "com.example.firebasegooglesignjetpackcompose"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.3'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
buildToolsVersion '33.0.0'
ndkVersion '33.0.0'
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
implementation "androidx.compose.ui:ui:$compose_ui_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
implementation 'androidx.compose.material:material:1.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-auth-ktx:21.3.0'
implementation 'com.google.android.gms:play-services-auth:20.5.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.0"
implementation "androidx.lifecycle:lifecycle-runtime-compose:2.6.0"
implementation "androidx.navigation:navigation-compose:2.5.3"
implementation "io.coil-kt:coil-compose:2.2.2"
}
below build.gradle
buildscript {
ext {
compose_ui_version = '1.4.0'
}
dependencies {
classpath 'com.google.gms:google-services:4.3.15'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
id 'com.google.gms.google-services' version '4.3.15' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I want to know where I am making mistake I am using android studio bumbble version
</details>
# 答案1
**得分**: 0
我通过将Android Studio版本从Bumble版本升级到Flamingo版本来解决了问题。
<details>
<summary>英文:</summary>
I fixed issue by updating android studio version from bumbble version to flamingo
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论