- Home /
Can't build into Android
hello guys ,i am new into android dev since it's already free on unity xD so i tried my mock project to build for android ,and everytime i build it ,i get this error
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) Picked up _JAVA_OPTIONS: -Xmx512M
and i already setup the environtment etc based on this video :http://www.youtube.com/watch?v=1Kf2D0UdgY0
and all working good based on that video ,that's why i don't know why i keep getting error :( and of course i already google and search on answers and forum ,but still ,nothing work, i already add java -xmx512 and the path for jdk and java ,but still doesn't work
please help :'(
Hard to say exactly where the problem is from that message alone.
What you can do is install the ADT (android development toolkit - very easy, follow this: http://developer.android.com/sdk/installing/bundle.html), and then ins$$anonymous$$d of creating an application, create an eclipse project (you have a checkbox to create an eclipse project in the build menu of Unity).
Then load the eclipse project with the android ADT (right click the workspace, select "import", select under "general" - "import existing project to workspace", and select the directory that you exported from unity.
Then try to build that project in eclipse (Run -> Run configurations, then double click "Android Application", in the project click browse and select your unity project. Click apply then run).
This will give you a more accurate error message as to the problem, and location in the code where the exception is being thrown. You might be able to understand yourself where the problem is, but if not you can post more info here and get more help.
Also, if you have any unity plugins that you are using, make sure they are compatible with android.
Good luck.
thanks dude ,will do and report soon if it still can't work :D
Answer by Daveoh · May 22, 2013 at 03:28 AM
I suspect this is the same problem which can be solved using this answer from another question: http://answers.unity3d.com/questions/461115/android-build-fails-with-unknown-reason-after-upgr.html#answer-461120
already did that since yesterday ,still no luck :(
edit : wait ,never$$anonymous$$d ,i check the sdk ,i already installed the r21 but i not yet installed the platform-tools thingy for r21 ,i'll download it now ,and report soon of it still can't work,thanks for the answer :D
edit again : and yes i can build it ,yaaaay ,thanks dude :D
Answer by amit-chai · Dec 31, 2013 at 10:38 PM
Ive installed java 32bit and now unity finds the jdk and and the android-sdk. it can also be installed in D:\ or whatever folder with android-jdk name. also ive needed to add JAVA_HOME PATH as mentioned in https://github.com/playgameservices/play-games-plugin-for-unity/issues/3 finally...
Your answer
Follow this Question
Related Questions
Send an activity from C# to Java 0 Answers
can't build android app with facebook sdk 5 Answers
Unity 3D Android - Building problems 1 Answer
CommandInvokationFailure: Failed to re-package resources 1 Answer
Failed to re-package resources. 16 Answers