- Home /
Android build fails with unknown reason after upgrading from Unity 3 to 4.
I just upgraded from Unity 3.5.7 to 4.1.2. I built to Android with no problems on Unity 3, but right now I cannot build using Unity 4 and I can't seem to find out why. Here is the error which is produced in Unity:
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)
Im getting the same thing, tried updating JD$$anonymous$$ and getting latest SD$$anonymous$$.
Answer by Daveoh · May 22, 2013 at 03:25 AM
I found the answer/current workaround in another Unity Answers thread.
The problem seems to be caused by using Android SDK Tools revision 22, and can be fixed by reverting to revision 21. To do this:
Open the Android SDK Manager, select Android SDK Tools and then click Delete Packages and confirm deletion.
Download revision 21 of the SDK tools here: Windows: http://dl.google.com/android/android-sdk_r21-windows.zip Mac OS X: http://dl.google.com/android/android-sdk_r21-macosx.zip
Extract the zip's contents to your android-sdk folder, typically in
C:\Program Files (x86)\Android\android-sdk
for Windows, and overwrite any existing files.Run Android SDK Manager again and install the Android SDK Platform-tools package.
Select the SDK path again in Unity if it isn't already, and attempt to build again.
Thanks for the thorough explanations - however this did not fix the problem on my machine.
On this $$anonymous$$ac I never had any older software running, and so I expect that the reason that some people can make this work is that for them it's enough to replace the r22 with r21.
But on machines starting up with Unity 4.1.2f1 and the current (r22) Android SD$$anonymous$$ with the accomplishing ADT bundle something more fundamental must be wrong. Replacing r22 with r21 is not fixing the issues. Or it's only possible on PC, I do not know.
State of the matter is that I purchased software that does not work. It's quite hard to grasp and stay calm about - it's USD 1,900 software after all. And it's not working.
I have been in contact with support, who asked me to file a screen dump of my About screen, but that is all from them so far. Now 3 days ago and counting..
A lot of people seem to have this problem so hopefully they will fix it soon. I agree that it is ridiculous to pay a large amount of money and it doesn't work. Have you actually tried replacing the Android tools, or did you not know where to find them?
I have made some hacks, and have some stuff working on downgraded versions, thanks. $$anonymous$$y biggest challenge now is that Unity Support tells me that the problem is on my side, that I am not following instructions.
I hope you all write them and let them know that I am not alone, the problem is on their side - or we will never have the option to work with r22 and what that brings.
Answer by sicklepickle · Jun 02, 2013 at 08:00 PM
For me, simply copying the tools folder from the r21 zip over my android-sdk\tools\ folder did the trick. (Be sure to close ADB etc).
Upon restarting the SDK manager, it listed the version as 21 (with 22 available) for "Android SDK Tools", and I was able to successfuly download "Android SDK Platform-tools"
Thanks for the nudge in the right direction Daveoh\mrueger.
Answer by mrueger · May 29, 2013 at 01:36 AM
What worked for me (on mac):
download the r21
copy it into a different location than the original Android SDK and set that new location in Unity
copy over the platform folders (platform-3..-17)
copy all tools and build-tools executables into both tools and platform-tools
I vaguely remember I had already patched up the Android environment for Unity 3.5x, I think I had also copied aapt, lib and dx into the platform-17 folder
there is probably some unnecessary stuff in the above list, but it got me back into a working state
Answer by elich11 · Jun 23, 2013 at 09:54 AM
I created a zip with r21 based on mrueger post. Simply extract it to any folder, then set unity to work with it (edit, preferences, external tool, Android SDK Location). You can download from here.
Did you lock that download or something? It says I can't access it with my google account.