首页 > 解决方案 > 无法解析 Android 应用程序模块的 Gradle 配置。解决 gradle 构建问题和/或重新同步。如何在北极狐 Updt 中解决此问题

问题描述

我在 android studio arctic fox update 中面临这个问题。这是我的 gradle 文件

第一

// 顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。buildscript { 存储库 { google() mavenCentral() } 依赖项 { 类路径“com.android.tools.build:gradle:7.0.0”}

}

任务清理(类型:删除){删除rootProject.buildDir}

第二个

插件 { id 'com.android.application' }

安卓 { compileSdk 31

defaultConfig {
    applicationId "com.mobilelegends.whatsapp"
    minSdk 21
    targetSdk 31
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),

'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } }

依赖{

implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' }

标签: androidgradle

解决方案


推荐阅读