美文网首页
一次构建机迁移导致unity打android失败记录

一次构建机迁移导致unity打android失败记录

作者: taiyosen | 来源:发表于2023-01-12 21:57 被阅读0次

问题

以前的老项目是用unity 5.6.3p4开发的,之前布在一台Mac机上进行构建,过了好几年,这个项目又复活了,而现在换了一台windows构建机,新项目也都采用unity 2019+,所以迁移过来后,首次构建就报错了:

Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more detail

根据度娘的说法,是因为android sdk tools版本问题,比如下面这篇:
https://blog.csdn.net/aikb6223/article/details/102349860

解决方法

使用android sdk tools 25.2.3

由于构建机上的android sdk tools是用Android SDK Command-Line Tools安装的,折腾一番发现无法通过sdkmanager更新${ANDROID_HOME}/tools
果不其然,看看 sdk-tools 页面上Android官方介绍:

image.png

比如这个页面介绍的安装Android sdk tools:
https://guides.codepath.com/android/installing-android-sdk-tools

image.png
文中所说的“Go to Android SDK and navigate to the SDK Tools Only section”,实际上Android官网上已经找不到这一section了,取而代之的是Command line tools only
image.png

所以只能通过下述链接下载25.2.3的sdk tools,替换掉${ANDROID_HOME}/tools文件夹,即可用来构建unity5.6.3项目了~
https://dl.google.com/android/repository/tools_r25.2.3-windows.zip

附录

sdkmanager命令行工具用法:
https://developer.android.com/studio/command-line/sdkmanager

相关文章

网友评论

      本文标题:一次构建机迁移导致unity打android失败记录

      本文链接:https://www.haomeiwen.com/subject/tdewcdtx.html