Android: Error building Player: Exception: android (invokation failed) ERROR: unknown error

Someone tell me how to build for Android?

I’ve been struggling with this for 4+ hours…

I have tried both Unity 4.0.0f7 and 4.1.3f3. I downloaded the latest Android ADT (Android Developer Tools), but it fails when I try and build.

I found references on the web that Android Tools R22 is not compatible with Unity, so I downgraded to Android R21.

Still no luck, whenever I build all I get is:

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)

When I run $ javac -version it tells me “javac 1.7.0_21”. So I figured it maybe too new, and I need JDK 1.6. I downloaded that from develper.apple.com, but the error above is still the same.

I am stuck. aarrgh

Hi, I’ve been having same issue at same time.

I suggest you look at http://forum.unity3d.com/threads/176737-unknown-error-when-building-simple-scene if you didn’t already find it.

Look at jvil’s answer.
I actually uninstalled Java7 as well, but don’t think that is necessary.

Good luck