识字粗堪供赋役,不须辛苦慕公卿。这篇文章主要讲述mac上unity2017设置Android打包相关的知识,希望能为你提供帮助。
1. 下载android SDK:通过下载Android Studio进行安装,但是下载Android Studio 3.6.1版本后,SDK Manage有变化。Unity打包需要的SDK Tools被Obsolete了,需要把Hide Obsolete Packages的勾选去掉才能看到。
文章图片
文章图片
2. 安装SDK Build-Tools 30-rc1之后,/Users/xxx/Library/Android/sdk/build-tools目录下,30-rc1的目录名称是30.0.0-rc1,会导致Unity打包会报错。
文章图片
有两种解决方法:
CommandInvokationFailure: Gradle build failed.
/Library/java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home/bin/java -classpath "/Users/jerryqin/Desktop/KH/Unity17EditorApp/MacEditor/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-4.6.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project ‘gradleOut‘.
> Failed to find Build Tools revision 30.0.0
* 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
]
stdout[
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (System.String workingdir, System.String task, System.Action`1 progress)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
解决方法1:把 30.0.0-rc1 目录改名为 30.0.0就可以
【mac上unity2017设置Android打包】 解决方法2:修改 Unity安装目录下的文件 /PlaybackEngines/AndroidPlayer/Tools/GradleTemplates/mainTemplate.gradle,改成其他版本的。
,
文章图片
推荐阅读
- App自动化-九宫格绘制
- 玩转-----appium的数据驱动ddt
- Android开发 run的时候出现waiting for debugger的情况,及解决问题
- AutoMapper 9.0快速上手,从老版本迁移到9.0+AutoMapper9.0和Autofac的完美结合
- APP自动化环境部署
- app测试专项--@松勤技术分享
- Android : 网络adb配置及有线端口占用解决方法
- android 按指定包名返回版本号
- Android Parcelable和Serializable的区别