昨天想要给Murphy同学编译一个Andorid版本的工程,但我本机没有Android SDK,于是安装了Murphy发给我的安装包,并升级设置,结果在发布的最后出现了如下错误:
Error building Player: Exception: android (invokation failed)
ERROR: unknown error
cmd:android list target -c
stdout;
stderr:
Exception in thread "main" java.lang.NullPointerException at SDKMain.main(SDKMain.java:62)
一时不知道为何,以为当前系统的jre不符合要求,于是去下载了最新的jre安装,依然不可以,后来去unity的论坛搜到了很多遇到该情况的帖子,按照其中一篇的方法最终解决了问题。原文地址:http://forum.unity3d.com/threads/176737-unknown-error-when-building-simple-scene。
大体意思是说:
从Android SDK r22开始,基于现有的“platform-tools”组件,又增加了一个新的编译工具SDK组件,以此来降低编译工具和IDE之间的版本耦合性,这样一来,以后升级SDK,就不需要IDE跟着一起升级。详见官方说明:http://developer.android.com/tools/sdk/tools-notes.html。
如果你同时拥有r21和r22,那么可以发现“platform_tools”目录下内容的区别:
Android r21 platform-tools content:
aapt.exe
adb.exe
AdbWinApi.dll
AdbWinUsbApi.dll
aidl.exe
api
dexdump.exe
dx.bat
fastboot.exe
lib
llvm-rs-cc.exe
NOTICE.txt
renderscript
source.properties
Android r22 platform-tools content:
adb.exe
AdbWinApi.dll
AdbWinUsbApi.dll
api
fastboot.exe
NOTICE.txt
source.properties
所以正是因为目录结构的和系统的改变,影响了当前Unity版本编译处理,当然了,也许改变还不止这些,所以当前最简单的解决办法有两个:
1:重新安装r21版本;
2:如果你坚持想用当前的r22版本,那么
copy:
$(android-sdk)/build-tools/17.0.0/ <-- 这个目录的内容是api17的编译工具
to:
$(android-sdk)/platform-tools/
方法2不是最好的和彻底的解决办法,但经本人试验,确实可行。
That's all.
希望以上能有所帮助,同时感谢亲爱的Murphy同学的帮助。
相关推荐
unity 发布webgl时打包出错 il2cpp.exe did not run properly!
可用于Android平台多摄像头设备要独立测试各个摄像头的场景,如手机,车载。 但是随着时间推移,可能会出现apk与过旧或者最新android SDK不匹配的问题,届时需要找类似的工程源码,重新编译生成apk。 在安装Camera...
打开 Android Studio 安装目录下的bin目录,查找并打开文件 studio.exe.vmoptions,修改代码: 代码如下:-Xmx512m 为 -Xmx256m 保存后应即可正常打开了。 您可能感兴趣的文章:Android Studio 引用外部依赖时报错的...
Caused by: android.system.ErrnoException: write failed: ENOSPC (No space lef
android Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated 97/100 android Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address ...
替换sdk路径下/platforms/android-29/android.jar,能够解决在android studio 看源码部分类报红及能够正常编译项目。解决替换后报错:Failed to transform file 'android.jar' to match attributes {artifactType=...
eclipse编译出来的apk,安装时报出INSTALL_FAILED_SHARED_USER_INCOMPATIBLE的错误。 原因:apk的AndroidManifest.xml中声明了android:sharedUserId="android.uid.system",但没有相应的签名 解决方案: 1. 找到编译...
最近我们发现很多用户在接入虹软ArcFace人脸识别SDK时,经常会遇到动态库加载失败的相关问题。...在安装应用时,APK中指定的ABI目录下没有发现指定的动态库,寻找apk中动态库的规则详见 https://developer
Android SDK中platforms下的android-34 自行解压
今天遇到了unity3d webplayer 在断网的情况 无法访问unity3d webplayer 下载这个就行了,虽然网上一搜就出来了 还是给大家免费共享下吧 链接地址是:...
Android SDK (SDK Platforms)-android-31.zip
Android App Linking > The ultimate developer guide to Android application linking methods Read documentation at https://simonmarquis.github.io/Android-App-Linking License Copyright 2017 Simon ...
Gradle脚本在Android中的使用
1. Android在eclipse下出现Failed to find an AVD compatible with target 'Android 1.5'. Launch aborted.错误 Failed to find an AVD compatible with target 'Android 1.5'. Launch aborted. [2009-04-29 15...
Android源码编译make的错误处理
Android SDK platforms 26,如果Android studio提示缺少platform26,即可下载此文件。解压到SDK安装目录的platforms文件夹下。其他版本请看我上传的其他资源。
2. 在布局文件中引用 xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@ id/item_one" android:layout_width="match_parent" android:layout_height="wrap_content" leon:leftIcon="@...
Android SDK (SDK Platforms)-android-33-ext5.zip
Android模拟器安装APP出现INSTALL_FAILED_NO_MATCHING_ABIS错误解决方案 当我们想在电脑的Android模拟器中安装APP的时候,会报INSTALL_FAILED_NO_MATCHING_ABIS错误【如图1】,导致APP无法在模拟器中运行。下面给出...
替换sdk路径下/platforms/android-29/android.jar,能够解决在android studio 看源码部分类报红及能够正常编译项目。解决替换后报错:Failed to transform file 'android.jar' to match attributes {artifactType=...