Android Studio中出现“Could not parse Android Application Module's Gradle config”错误

bq3bfh9z  于 2023-04-18  发布在  Android
关注(0)|答案(1)|浏览(98)

我正在开发jetpack撰写android应用程序使用firebase,但当我运行项目,我得到以下异常
无法解析Android应用程序模块的Gradle配置。解决Gradle构建问题和/或重新同步我遵循了此答案Android Studio's project gradle file changed?,但它没有解决我的问题
在我的app.gradle文件下面

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

低于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
}

我想知道我在哪里犯了错误,我使用的是Android Studio Bumbble版本

axkjgtzd

axkjgtzd1#

我通过更新Android Studio版本从Bumbble版本到Flamingo修复了这个问题

相关问题