You get latest content at a time when data will updated
Automaticaly take backup as par schedule
Allow to show public user message
安卓studio指定本地gradle文件 [code_highlight language="html" sh...
安卓studio指定本地gradle文件
#Wed Sep 11 23:05:55 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=file:///C:/Users/Administrator/.gradle/wrapper/dists/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
配置参考:
[raw]
// 需要声明 Android 应用插件
apply plugin: ‘com.android.application’
android {
compileSdkVersion 28 // 根据你的SDK版本设置
defaultConfig {
applicationId "com.yileweb.legend"
minSdkVersion 16 // 根据需求设置
targetSdkVersion 30 // 与compileSdkVersion一致或更高
versionCode 1
versionName "1.0"
ndk {
abiFilters ‘armeabi-v7a’, ‘arm64-v8a’ // 根据需要选择ABI
}
externalNativeBuild {
ndkBuild {
path "jni/Android.mk" // 确保路径正确
}
}
}
signingConfigs {
release {
storeFile file("D:/brm/my-release-key.keystore")
storePassword "123456"
keyAlias "zhuxijing"
keyPassword "123456"
}
}
buildTypes {
release {
minifyEnabled false // 如果需要混淆,设置为true
signingConfig signingConfigs.release
}
}
externalNativeBuild {
ndkBuild {
path "jni/Android.mk" // 确保路径正确
}
}
}
// build.gradle 文件的 "buildscript" 块
buildscript {
repositories {
maven {
url ‘https://maven.aliyun.com/repository/public/’
}
maven {
url ‘https://maven.aliyun.com/repository/central’
}
maven { url ‘https://mirrors.cloud.tencent.com/gradle/’ }
maven { url ‘https://maven.aliyun.com/repository/google’ }
maven { url ‘https://maven.aliyun.com/repository/jcenter’}
maven { url ‘https://maven.aliyun.com/nexus/content/groups/public/’ }
maven { url ‘https://mirrors.huaweicloud.com/repository/maven/’ }
maven { url ‘https://mirrors.ustc.edu.cn/maven/’ }
maven { url ‘https://maven.jd.com/’ }
maven { url ‘https://mirrors.tencent.com/nexus/content/groups/public/’ }
maven { url ‘https://maven.163.com/repository/maven-public/’ }
maven { url ‘https://www.jitpack.io’ }
maven { url ‘https://maven.aliyun.com/repository/google’}
maven { url ‘https://maven.aliyun.com/repository/gradle-plugin’}
maven { url ‘https://maven.aliyun.com/repository/public’}
google()
jcenter()
mavenLocal()
mavenCentral()
}
dependencies {
classpath ‘com.android.tools.build:gradle:8.7.0’ // 升级到更高的版本
}
}
// 项目级 repositories 块
repositories {
maven {
url ‘https://maven.aliyun.com/repository/public/’
}
maven {
url ‘https://maven.aliyun.com/repository/central’
}
maven { url ‘https://mirrors.cloud.tencent.com/gradle/’ }
maven { url ‘https://maven.aliyun.com/repository/google’ }
maven { url ‘https://maven.aliyun.com/repository/jcenter’}
maven { url ‘https://maven.aliyun.com/nexus/content/groups/public/’ }
maven { url ‘https://mirrors.huaweicloud.com/repository/maven/’ }
maven { url ‘https://mirrors.ustc.edu.cn/maven/’ }
maven { url ‘https://maven.jd.com/’ }
maven { url ‘https://mirrors.tencent.com/nexus/content/groups/public/’ }
maven { url ‘https://maven.163.com/repository/maven-public/’ }
maven { url ‘https://www.jitpack.io’ }
maven { url ‘https://maven.aliyun.com/repository/google’}
maven { url ‘https://maven.aliyun.com/repository/gradle-plugin’}
maven { url ‘https://maven.aliyun.com/repository/public’}
google()
jcenter()
mavenLocal()
mavenCentral() // 保留官方 Maven 中央仓库作为备用
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation ‘androidx.appcompat:appcompat:1.2.0’
implementation ‘com.google.android.material:material:1.3.0’
implementation ‘androidx.constraintlayout:constraintlayout:2.0.4’
testImplementation ‘junit:junit:4.13.2’
}
// 插件报告仅用于项目报告生成,如不需要可移除
// apply plugin: ‘project-report’
[/raw]