1.android studio版本
Android Studio 4.1
Build #AI-201.8743.12.41.6858069, built on September 23, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
2.设置腾讯的镜像库
\gradle\wrapper\gradle-wrapper.properties
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-5.4.1-bin.zip
目的:通过腾讯镜像系在gradle
3.增加阿里云的镜像
02.build.gradle
buildscript {
repositories {
//增加阿里云路径
maven {
url 'https://maven.aliyun.com/repository/google/'
}
maven {
url 'https://maven.aliyun.com/repository/jcenter/'
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.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/repository/google/'
}
maven {
url 'https://maven.aliyun.com/repository/jcenter/'
}
google()
jcenter()
mavenCentral()
}
//为了解决Execution failed for task ':XXXX:mockableAndroidJar'.,没有问题可以不加
gradle.taskGraph.whenReady {
tasks.each { task ->
if (task.name == 'mockableAndroidJar') {
task.enabled = false
}
}
}
}
4.编译jar
在Terminal中运行gradlew makeJar
\Android\sdk\build-tools\30.0.2
然后d8 --output test.jar test.jar
- 出现问题:
cvc-complex-type.2.4.a: ��������Ԫ�� 'base-extension' ��ͷ����Ч���ݡ�Ӧ�� '{layoutlib}' ֮һ��ͷ��文章来源:https://www.toymoban.com/news/detail-811715.html
修改classpath 'com.android.tools.build:gradle:3.5.2'
3.5.2应该是对应特定版本,需要检证文章来源地址https://www.toymoban.com/news/detail-811715.html
到了这里,关于android studio设置国内镜像的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!