x


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)
 
more ▼

asked May 22, 2013 at 02:57 AM

avatar image

Daveoh
218 6 6 24

Im getting the same thing, tried updating JDK and getting latest SDK.

May 22, 2013 at 03:05 AM shaddadjr85
(comments are locked)
10|3000 characters needed characters left

5 answers: sort voted first

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.

more ▼

answered May 22, 2013 at 03:25 AM

avatar image

Daveoh
218 6 6 24

Thanks for the thorough explanations - however this did not fix the problem on my machine.

On this Mac 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 SDK 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..

May 22, 2013 at 08:59 AM Fritsl

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?

May 22, 2013 at 03:49 PM Daveoh

I have made some hacks, and have some stuff working on downgraded versions, thanks. My 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.

May 23, 2013 at 11:40 AM Fritsl

Those steps worked for me, thanks!

May 23, 2013 at 10:26 PM davekalina

Genius! Thanks! #fixed

May 24, 2013 at 12:23 AM kingdutka
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Jun 02, 2013 at 08:00 PM

avatar image

sicklebrick
1 1

thanks.. @sicklebrick your answer helps me a lot..

Jul 25, 2014 at 07:14 AM kenjoegolo
(comments are locked)
10|3000 characters needed characters left

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

more ▼

answered May 29, 2013 at 01:36 AM

avatar image

mrueger
1

(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Jun 23, 2013 at 09:54 AM

avatar image

elich11
1

Did you lock that download or something? It says I can't access it with my google account.

Feb 19, 2014 at 09:13 PM kr4ft3r
(comments are locked)
10|3000 characters needed characters left

Is their a proper fix for this issue yet? I have not yet tried to downgrade because I would hope a year later there would be a change. Am about to down grade though and will post results now

more ▼

answered May 06, 2014 at 05:36 PM

avatar image

Psyco92
0 26

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1371
x334

asked: May 22, 2013 at 02:57 AM

Seen: 21772 times

Last Updated: Jul 25, 2014 at 07:14 AM