配置下载源,第一行放上面,其余放下面
buildscript { repositories { maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/' } google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.7.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' } maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' } google() mavenCentral() } } task clean(type: Delete) { delete rootProject.buildDir }
配置Gradle路径和下载源
distributionUrl=file:///D:/Gradle/gradle-8.9-all/gradle-8.9
distributionUrl=https\://mirrors.huaweicloud.com/gradle/gradle-8.9-bin.zip
常量表达式问题
Android studio升级gradle后引起case R.id.xx出现“需要常量表达式”的错误_android 错误: 需要常量表达式-CSDN博客
gradle.properties
android.nonFinalResIds=false