打包机------新项目打Android包遇到如下问题:
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.1.1/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
> Task :clean UP-TO-DATE
BUILD SUCCESSFUL in 4s
1 actionable task: 1 up-to-date
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/6.1.1/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
WARNING: The specified Android SDK Build Tools version (29.0.0) is ignored, as it is below the minimum supported version (29.0.2) for Android Gradle Plugin 4.0.1.
Android SDK Build Tools 29.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '29.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':compileReleaseJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/******/Projects/UnityProject/******/******/Publish/proj.android-studio/local.properties'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
报错信息:
Could not determine the dependencies of task ':compileReleaseJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/******/Projects/UnityProject/******/******/Publish/proj.android-studio/local.properties'.
错误分析: 打包时找不到Android SDK的路径。
解决方案: 打包时可以找到Android_SDK即可,以下方案任选其一即可:
(1) 添加环境变量ANDROID_SDK_ROOT(建议此方法,因为别的地方有可能也会用到;新开其他项目也可用到;)
(2) 在proj.android-studio/local.properties中添加Android SDK绝对路径: 在AndroidStudio–Preferences…–Android Sdk–Android SDK Localtion中设置绝对路径会自动生成文件(local.properties)并写入SDK的路径(sdk.dir=/Users/******/Projects/android/studio_SDK)
|