Unity android ndk及Gradle

使用联通网络上网,无法直接通过Unity Hub下载Android SDK和NDK

只能通过FQ,再手动下载

https://dl.google.com/android/repository/android-ndk-r19-windows-x86_64.zip

https://dl.google.com/android/repository/android-ndk-r21d-windows-x86_64.zip

Program Files\Unity\2021.3.11f1c1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates\baseProjectTemplate.gradle

allprojects {
    buildscript {
        repositories {**ARTIFACTORYREPOSITORY**
            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' }
            //google()
            //jcenter()
        }

    repositories {**ARTIFACTORYREPOSITORY**
        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' }
        //google()
        //jcenter()

https://ping.chinaz.com/dl.google.com

得到host

220.181.174.33       dl.google.com

下载地址:

https://developer.android.google.cn/ndk/downloads/

下载时,需要匹配版本

Unity android ndk及Gradle_第1张图片

https://github.com/android/ndk/wiki/Unsupported-Downloads

Unity 2021.3.11提示需要 NDK r21d

Unity android ndk及Gradle_第2张图片

 Unity 2020.3.4 提示需要 NDK r19

Unity android ndk及Gradle_第3张图片

 Unity android ndk及Gradle_第4张图片 

配置后,虽然还是会提示警告,不是建议的版本,但至少是可以编译的了

你可能感兴趣的:(XR/VR,android)