Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Can't put the android sdk folder to work

Discussion in 'Android' started by fabiobh, May 29, 2013.

  1. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    Hi,

    I begin to use Unity to create games for android, but when the unity ask for the android sdk folder, I put the folder but I receive an error.

    Errr building player: Exception :Android (invocation failed)

    I still try to use regedit and put the android sdk folder manually in the Unity registry inside Windows, but everytime that I run Unity, Unity reset the value.

    How I could make this work correctly?

    I use Unity 4.1.3f
     
  2. TheRaider

    TheRaider

    Joined:
    Dec 5, 2010
    Posts:
    2,250
    This is the using the new version of the SDK, revision 22 doesn't work.
     
  3. fabiobh

    fabiobh

    Joined:
    May 28, 2013
    Posts:
    92
    It's possible to make a downgrade in android sdk? or is necessary to download a old android sdk version?

    !edited!

    I have an old android sdk installation in my netbook that have revision 20, it works now , thanks
     
    Last edited: May 30, 2013
  4. emjustem

    emjustem

    Joined:
    May 30, 2013
    Posts:
    1
    Got this fixed for myself today. Download the Android SDK 22 version. Then copy and move the content from android-sdk\sdk\build-tools\android-4.2.2 (or api 17) folder to ...\sdk\platform-tools. This fixed the problem for me at least and I was able to build again for my tablet :)
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    That didn't work for me. Luckily I have the older version installed on my Mac boot camp. I'll try to copy that over to the PC. Wish me luck!
     
  6. _creatio_

    _creatio_

    Joined:
    Mar 21, 2013
    Posts:
    43
    Got the same problem.
    After upgrading android sdk to the last version, Unity fails to build my game.
     
  7. alex_audi

    alex_audi

    Joined:
    Dec 19, 2011
    Posts:
    7
    hi,
    I ve the same problem on windows 7 64bit with unity 4.1.3f3....when try to build an apk
    I already tried to put in my environment variables :

    _JAVA_OPTIONS = -Xmx512M
    path=
    C:\Program Files (x86)\Java\jdk1.7.0_21\bin;
    C:\Program Files (x86)\Java\jre7\bin;
    C:\android-sdk-windows-1.6_r1\tools

    i already tried to use 2.2 platform instead 4.2

    i already tried to use ADT BUNDLE 64 bit or 32 bit

    i already tried to use old sdk version 1.6 r1

    the error 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)
    Picked up _JAVA_OPTIONS: -Xmx512M

    before update environment path the error was:
    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)
     
    Last edited: Jun 5, 2013
  8. Ben-Stoneman

    Ben-Stoneman

    Services Support

    Joined:
    Jan 19, 2012
    Posts:
    52
  9. feddarkk

    feddarkk

    Joined:
    Jun 6, 2013
    Posts:
    12
    maaaan! thaaaank you very muuuch!!! :D
     
  10. StevenSauer

    StevenSauer

    Joined:
    Mar 25, 2013
    Posts:
    19
    Hey everyone!

    I was having this problem as well, but the recent Unity 4.1.4f1 update fixed this problem with android SDK r22. It works fine for me now, just had to update unity
     
  11. bowlercaptain

    bowlercaptain

    Joined:
    Feb 21, 2013
    Posts:
    2
    Thank you so much, emjustem. I've been slamming my head against this problem for weeks. Why do we have to do this? What's the problem? Did they change the arrangement of the SDK in the new version and Unity hasn't figured it out yet or something?
     
  12. Jtbentley_v2

    Jtbentley_v2

    Joined:
    Sep 5, 2012
    Posts:
    174
    Does anyone know where we can download r21 or downgrade the existing version? Unfortunately due to plugin dependancy I can't update my unity even when they do fix this..

    The copying of the platform tools did work however.
     
  13. citycrusher

    citycrusher

    Joined:
    Sep 26, 2010
    Posts:
    41
    i have version 22 of ADT. with the fixes mentioned above i have reverted the SDK successfully to v21. this solves any direct build from unity problem now goes smooth. all errors eliminated. so thank you very much guys for posting the fixes! for last two day i have been struggling with this trying to solve.

    however i also have to do some work in eclipse and i now see a message on start up "This version of ADT requires Android SDK Tools revision 22.0.0 or above. Current revision is 21.0.0 (Open SDK Manager) (Close)"

    i can just click close on the message and continue to work in eclipse without any visible issue. could any eclipse expert tell me if this is an ignorable message, is it just some artifact of this customised set up? i am not doing anything fancy just adding generic Samsung Ad Hub package so I need to use eclipse for this :roll:

    i have no interest in targeting the very newest whatevers so i am hoping it is just an ignorable message?

    if i do need to revert my ADT to previous version, any clue how to do it? i would need a step by step guide as i can't find ADT v21 anywhere!
     
  14. MrCow

    MrCow

    Joined:
    Jan 25, 2013
    Posts:
    2
    This worked for me! Thanks mate.

    I just copied the contents from the "android-4.2.2" folder and pasted them into the "platform-tools",