新Unity项目android打包问题

打包机------新项目打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)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值