gradle编译问题
打开 gradle所在路径,如:C:\Program Files\Unity 2020.3.30f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates,
编辑baseProjectTemplate.gradle,替换成阿里云的源
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
allprojects {
buildscript {
repositories {**ARTIFACTORYREPOSITORY**
maven{ url 'https://maven.aliyun.com/repository/google'}
//google()
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
//jcenter()
}
dependencies {
// If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity
// See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html
// See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
// To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
classpath 'com.android.tools.build:gradle:4.0.1'
**BUILD_SCRIPT_DEPS**
}
}
repositories {**ARTIFACTORYREPOSITORY**
maven{ url 'https://maven.aliyun.com/repository/google'}
//google()
maven{ url 'https://maven.aliyun.com/repository/jcenter'}
//jcenter()
flatDir {
dirs "${project(':unityLibrary').projectDir}/libs"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android sdk build-tools编译问题
Installed Build Tools revision 33.0.0 is corrupted. Remove and install again using the SDK Manager.
- 将\build-tools\33.0.0下的d8.bat复制,改名成dx.bat
- 将\build-tools\33.0.0\lib下的d8.jar复制,改名成dx.jar