I wanted to compile an Andorid project for Murphy yesterday, but I didn't have the Android SDK on my computer. So I installed the installation package sent to me by Murphy and upgraded the settings, the following error occurs at the end of the release:
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)
I don't know why, so I thought the current system's jre does not meet the requirements, so I downloaded the latest jre installation, but it still does not work, later, I went to the unity Forum and found many posts that encountered this problem. I finally solved the problem according to one of the methods. Original article address: http://forum.unity3d.com/threads/176737-unknown-error-when-building-simple-scene.
The general meaning is:
Starting from Android SDK r22, a new compilation tool SDK component is added based on the existing "platform-tools" component to reduce version coupling between the compilation tool and IDE, in this way, you do not need to upgrade the SDK along with the IDE. For details, refer to official instructions: http://developer.android.com/tools/sdk/tools-notes.html.
If you have both r21 and r22, you can find the differences between the content in the "platform_tools" directory:
Android r21Platform-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 r22Platform-tools content:
Adb.exe
AdbWinApi. dll
AdbWinUsbApi. dll
Api
Fastboot.exe
NOTICE.txt
Source. properties
Therefore, the directory structure and system changes affect the compilation and processing of the Current Unity version. Of course, there may be more than these changes, so there are two simple solutions:
1: reinstall r21;
2:If you want to use the current r22 version, Then
Copy:
$ (Android-sdk )/Build-tools/17.0.0/<-- the content of this directory is the compilation tool of api17.
To:
$ (Android-sdk )/Platform-tools/
Method 2 is not the best and thorough solution, but it is feasible after my experiments.
That's all.
I hope the above will help you and thank you for your help.
This article Reprinted from: http://www.th7.cn/Program/Android/201305/138526.shtml