Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Error when trying to create an Android build

Discussion in 'Android' started by Puppy, Mar 13, 2012.

  1. Puppy

    Puppy

    Joined:
    May 12, 2010
    Posts:
    64
    It all goes well until it asks me for the locations of the SDK root folder. I pick it up and then the build process aborts with the following error:


    Error building Player: Win32Exception: ApplicationName='java.exe', CommandLine='-Dcom.android.sdkmanager.toolsdir="C:/Android/androidsdk\tools" -classpath "C:\Program Files (x86)\Android\android-sdk\tools\lib\sdkmanager.jar" com.android.sdkmanager.Main list targets', CurrentDirectory=''


    Any idea what I'm doing wrong? :-O
     
  2. _Petroz

    _Petroz

    Joined:
    May 13, 2010
    Posts:
    730
    Have you installed the java and android SDKs?
     
  3. Puppy

    Puppy

    Joined:
    May 12, 2010
    Posts:
    64
    Yep.
     
  4. OmniverseProduct

    OmniverseProduct

    Joined:
    Feb 26, 2012
    Posts:
    1,569
    Did you set the location of the Android SDK in preferences? Go to Edit, Preferences. When you are in preferences it will be under External Tools.
     
  5. Puppy

    Puppy

    Joined:
    May 12, 2010
    Posts:
    64
    OK, I did that...

    So now rather than ask me for the location and then abort with an error - it aborts with an error automatically. There can't be something wrong with my installation of the SDK, is it? How can I find out? It's freshly installed.
     
  6. OmniverseProduct

    OmniverseProduct

    Joined:
    Feb 26, 2012
    Posts:
    1,569
    I don't know if my problem is related to your problem, but I had the problem of Unity not recognizing the location of the Android SDK. I selected the right folder and root folder, but it flat out refused to take that location. Instead I download the zipped file and put it in the location I chose (my external hard drive) and selected the folder and it took it immediately. No problems what so ever.

    However, I'm now having the problem of not being able to update and download plug-ins via the SDK. I have no clue why.
     
  7. Swearsoft

    Swearsoft

    Joined:
    Mar 19, 2009
    Posts:
    1,629
    Have you installed a lot of versions (like 1.5, 1.6 etc)? I had to remove the whole thing,installed only with what I needed (above 2.3) and the problems got solved. Also in a recent SDK something did change location, I don't remember exactly what, but it did affect unity (something left tools or platform-tools), I just made a copy to the old location.
     
  8. Cigi

    Cigi

    Joined:
    Aug 18, 2009
    Posts:
    5
    I had also this kind of problem. The Console said me this stuff :
    Well, it's quite different from you but maybe what i did will help you. You have noticed that he asked me for the aapt file. In the android-15 you don't have it automatically (mmm sure ?). You need the SDK-tools. You'll have to download it from the sdk Manager or manually : http://www.hariadi.org/android/manually-download-of-android-sdk-tools-and-sdk-platform-tools/

    Once you have downloaded it, unzip the content it in your <stuff>/android-15/ folder. After this, Unity will be able to make your .apk.
     
  9. bubbalovesponge

    bubbalovesponge

    Joined:
    Nov 8, 2012
    Posts:
    69
    NOTES for user:
    If you get this error: unity3d C:/Program Files/Android/android-sdk/sdk/platforms/android-17\aapt.exe'Do a find for the file aapt.exe. then copy that file to the android-17 or 15 or 14 or where ever it pops up.

    if you get an error for the adb.exe then copy the file in the folder platform-tools to the tools folder.
     
    Last edited: May 21, 2013
  10. imnimn

    imnimn

    Joined:
    Jun 19, 2013
    Posts:
    7
    Error building Player: Win32Exception: ApplicationName='C:\Users\name\AppData\Local\Android\android-sdk\build-tools\18.0.1\aapt.exe', CommandLine='package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Users/name/AppData/Local/Android/android-sdk/platforms/android-18\android.jar" -F bin/resources.ap_', CurrentDirectory='Temp/StagingArea'


    Actually I had hte same error and I had the files in the place that the error said
    I don't know what should I do please help me
     
  11. CarlLydon

    CarlLydon

    Joined:
    Oct 9, 2012
    Posts:
    17
    How is something so expensive (the Android exporter) allowed to be so jacked up in terms of installation, documentation and use? It's like, if developers are involved, it's ok to have a 20 step installation process and a bug hunt to boot, when what really should happen is you double click an installer, submit your serial number AND IT WORKS.

    Eventually I did get it working based on workarounds here in the forums. The docs need to be updated with accurate information so new android developers can download the correct stuff the first time around. The docs don't mention installing Java, how to find the SDK manager on a mac (there's no icon for it), that the latest version of the SDK won't work, or needs to be 32 bit. It seems to me that almost 100% of people that begin by following the instructions here:

    http://docs.unity3d.com/Documentation/Manual/android-sdksetup.html

    Will have errors and unanswered questions, and have to search the forums for workarounds because it leaves out important info and gives wrong downloads.
     
    Last edited: Nov 1, 2013
  12. CarlLydon

    CarlLydon

    Joined:
    Oct 9, 2012
    Posts:
    17
    Note: After upgrading Unity to 4.x I had to start over.
    For 4.x you can download the most recent SDK and you don't have to move folders around to get it to work. Mac users should know that after downloading the adt-bundle folder here, you're not done. You then have to run the SDK manager, which you get to by running eclipse (you may have to point it to some things to get it working) and then reach the SDK through a drop down in eclipse. Some of the instructions I've seen imply that the manager has it's own icon but it doesn't seem to on the mac? I just installed everything that was offered in the list of possible installs, including all versions/levels of android. I didn't reinstall anything else like Java.
     
unityunity