Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

unknown error when building simple scene

Discussion in 'Android' started by Michixxx, Apr 3, 2013.

  1. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Please, could some Android guru say what version of JAva must be installed to use Android r22 and unity3d 4.1.4 ?
     
  2. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Sorry guys but I need help...

    I have updated java version with:

    But when I try to build an android APK I have always the same 2 errors:

    1) Failed to re-package resources with the following parameters:
    package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk/platforms/android-16\android.jar" -F bin/resources.ap_

    UnityEngine.Debug:LogError(Object)
    PostProcessAndroidPlayer:postProcessInternal(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/BuildPipeline/PostProcessAndroidPlayer.cs:334)
    PostProcessAndroidPlayer:postProcess(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/BuildPipeline/PostProcessAndroidPlayer.cs:151)
    UnityEditor.HostView:OnGUI()

    2) Error building Player: UnityException: Resource re-package failed!
    Failed to re-package resources. See the Console for details.

    Please, any idea?
     
  3. vlab22

    vlab22

    Joined:
    Nov 22, 2012
    Posts:
    17
    ThankYou++
     
  4. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Guys really I don't understand... what Unity3D version are you using?

    ...and with which Android SDK Version installed?
     
  5. LoftyTheMetroid

    LoftyTheMetroid

    Joined:
    Oct 26, 2012
    Posts:
    57
    I'm hoping my issue is related to the ones presented in this thread. I love Unity, but this has been one of the most frustrating experiences I've had in a long while. I've wasted nearly an entire day trying to get this to work. (Watch it be something small and silly...)

    I'm trying to build a simple Android package with Unity. It's just a simple scene with a cube and a camera. I'm using OSX with the latest versions of Unity and Java. Here's my current error:

    I've tried every solution I can find.

    Neither this...

    ...nor this...

    ...have worked for me. I don't know what else to do. Any suggestions?
     
  6. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    This problem it's a nightmare for me...
    I'm stuck for more than a week, before this latest update everything was working properly.


    I have tryed to uninstall all (Unity3D,Java+JDK+Android SDK) from my PC, I have cleaned the register and after this I have reinstalled following packages in this order:

    1) jdk-7u25-windows-i586.exe

    2) Android installer_r22-windows.exe and all my android platform API: 10, 12, 16 and 17
    (I have also tryed with installer_r21-windows.exe too, but the problem is the same)

    3) UnitySetup-4.1.5.exe
    Until here all works fine.

    Then I have tryed to build a simple empty scene with unity and as usual I have this error:

    Failed to re-package resources with the following parameters:
    package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk/platforms/android-17\android.jar" -F bin/resources.ap_


    I have noticed something strange...
    if I build an apk for API 12, unity3d give me always the same error for android-17:

    Failed to re-package resources with the following parameters:
    package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk/platforms/android-17\android.jar" -F bin/resources.ap_


    Why this happen?

    My PC is using Win7 64 bit, may be is better to install jdk for 64bit?

    Please, any idea?
    Or any other guy with the same problem?
     
  7. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    This problem it's a nightmare for me...
    I'm stuck for more than a week, before this latest update everything was working properly.


    I have tryed to uninstall all (Unity3D,Java+JDK+Android SDK) from my PC, I have cleaned the register and after this I have reinstalled following packages in this order:

    1) jdk-7u25-windows-i586.exe

    2) Android installer_r22-windows.exe and all my android platform API: 10, 12, 16 and 17
    (I have also tryed with installer_r21-windows.exe too, but the problem is the same)

    3) UnitySetup-4.1.5.exe
    Until here all works fine.

    Then I have tryed to build a simple empty scene with unity and as usual I have this error:

    Failed to re-package resources with the following parameters:
    package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk/platforms/android-17\android.jar" -F bin/resources.ap_


    I have noticed something strange...
    if I build an apk for API 12, unity3d give me always the same error for android-17:

    Failed to re-package resources with the following parameters:
    package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk/platforms/android-17\android.jar" -F bin/resources.ap_


    Why this happen?

    My PC is using Win7 64 bit, may be is better to install jdk for 64bit?

    Please, any idea?
    Or any other guy with the same problem?

    EDIT: Sorry for double post due to a connection problem... :oops:
     
    Last edited: Jun 20, 2013
  8. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
  9. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    @kenshin, do you mind posting the full error message? Either extracting it from the console or from the Editor.log
     
  10. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Hi Martin,

    thanks for your post, this is the error taken from console:

    Failed to re-package resources with the following parameters:
    package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk/platforms/android-17\android.jar" -F bin/resources.ap_

    UnityEngine.Debug:LogError(Object)
    PostProcessAndroidPlayer:postProcessInternal(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/BuildPipeline/PostProcessAndroidPlayer.cs:334)
    PostProcessAndroidPlayer:postProcess(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/BuildPipeline/PostProcessAndroidPlayer.cs:151)
    UnityEditor.HostView:OnGUI()

    Error building Player: UnityException: Resource re-package failed!
    Failed to re-package resources. See the Console for details.

    Please, let me know if you need more info! :)
     
  11. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    Not enough information :( Could you try the Editor.log and see if that shows any additional information?
     
  12. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    I have Unity3D PRO and Android PRO licenses (previously all worked fine with it... before lust update).
    I have opened Unity3D with and empty project and tryed to build an APK.

    Here you can find Editor.log file content:

    Validating Project structure ... 0.000175 seconds.
    Refresh, detecting if any assets need to be imported or removed ... 0.001200 seconds (Nothing changed)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\System.Xml.Linq.dll (this message is harmless)
    System memory in use before: 5.0 MB.
    Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 3.2 MB.

    Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 313.
    Total: 5.258024 ms (FindLiveObjects: 0.017205 ms CreateObjectMapping: 0.004829 ms MarkObjects: 0.433162 ms DeleteObjects: 0.004829 ms)

    <RI> Initializing input.

    <RI> Input initialized.

    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Managed\nunit.framework.dll (this message is harmless)
    EditorUpdateCheck: Response {updateinterval: '3600'} updateurl = interval = 3600
    Refresh, detecting if any assets need to be imported or removed ... 0.002827 seconds (Nothing changed)
    building target 13
    System memory in use before: 13.8 MB.
    Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 10.6 MB.

    Unloading 65 unused Assets to reduce memory usage. Loaded Objects now: 464.
    Total: 15.775280 ms (FindLiveObjects: 0.082406 ms CreateObjectMapping: 0.018715 ms MarkObjects: 2.039035 ms DeleteObjects: 1.010311 ms)



    Mono dependencies included in the build
    Dependency assembly - Mono.Security.dll
    Dependency assembly - System.dll
    Dependency assembly - mscorlib.dll

    System memory in use before: 11.6 MB.
    Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 10.5 MB.

    Unloading 2 unused Assets to reduce memory usage. Loaded Objects now: 452.
    Total: 4.119424 ms (FindLiveObjects: 0.034411 ms CreateObjectMapping: 0.006942 ms MarkObjects: 0.962617 ms DeleteObjects: 0.009357 ms)

    System memory in use before: 11.9 MB.
    Unloading 1 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 10.7 MB.

    Unloading 29 unused Assets to reduce memory usage. Loaded Objects now: 495.
    Total: 4.276088 ms (FindLiveObjects: 0.038033 ms CreateObjectMapping: 0.007848 ms MarkObjects: 0.958995 ms DeleteObjects: 0.121044 ms)

    System memory in use before: 10.7 MB.
    Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 10.7 MB.

    Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 495.
    Total: 3.685658 ms (FindLiveObjects: 0.080897 ms CreateObjectMapping: 0.015092 ms MarkObjects: 2.150721 ms DeleteObjects: 0.013281 ms)

    System memory in use before: 94.2 MB.
    Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 73.4 MB.

    Unloading 34 unused Assets to reduce memory usage. Loaded Objects now: 518.
    Total: 15.106369 ms (FindLiveObjects: 0.030487 ms CreateObjectMapping: 0.007244 ms MarkObjects: 0.991897 ms DeleteObjects: 11.736754 ms)

    System memory in use before: 74.6 MB.
    Unloading 1 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 73.5 MB.

    Unloading 29 unused Assets to reduce memory usage. Loaded Objects now: 559.
    Total: 4.295406 ms (FindLiveObjects: 0.047089 ms CreateObjectMapping: 0.008150 ms MarkObjects: 0.986766 ms DeleteObjects: 0.123458 ms)


    Textures 0.0 kb 0.0%
    Meshes 0.0 kb 0.0%
    Animations 0.0 kb 0.0%
    Sounds 0.0 kb 0.0%
    Shaders 0.0 kb 0.0%
    Other Assets 0.0 kb 0.0%
    Levels 6.7 kb 0.2%
    Scripts 0.0 kb 0.0%
    Included DLLs 3.7 mb 99.6%
    File headers 8.1 kb 0.2%
    Complete size 3.7 mb 100.0%

    Used Assets, sorted by uncompressed size:
    System memory in use before: 73.4 MB.
    Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 73.5 MB.

    Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 559.
    Total: 3.730031 ms (FindLiveObjects: 0.078784 ms CreateObjectMapping: 0.015394 ms MarkObjects: 2.188453 ms DeleteObjects: 0.012979 ms)

    Failed to re-package resources with the following parameters:
    package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk/platforms/android-17\android.jar" -F bin/resources.ap_

    UnityEngine.Debug:Internal_Log(Int32, String, Object)
    UnityEngine.Debug:LogError(Object)
    PostProcessAndroidPlayer:postProcessInternal(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\BuildPipeline\PostProcessAndroidPlayer.cs:334)
    PostProcessAndroidPlayer:postProcess(BuildTarget, String, String, String, String, String, String, BuildOptions) (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\BuildPipeline\PostProcessAndroidPlayer.cs:151)
    UnityEditor.PostprocessBuildPlayer:postprocess(BuildTarget, String, String, String, Int32, Int32, String, String, BuildOptions, RuntimeClassRegistry) (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\BuildPipeline\PostprocessBuildPlayer.cs:294)
    UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, BuildTarget, BuildOptions, Boolean)
    UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions, Boolean) (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\BuildPlayerWindow.cs:641)
    UnityEditor.BuildPlayerWindow:BuildPlayerWithDefaultSettings(Boolean, BuildOptions) (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\BuildPlayerWindow.cs:510)
    UnityEditor.BuildPlayerWindow:GUIBuildButtons(Boolean, Boolean, Boolean, BuildPlatform) (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\BuildPlayerWindow.cs:1400)
    UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings() (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\BuildPlayerWindow.cs:1368)
    UnityEditor.BuildPlayerWindow:OnGUI() (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\BuildPlayerWindow.cs:1033)
    System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception)
    System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) (at /Applications/buildAgent/work/84669f285f6a667f/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    System.Reflection.MethodBase:Invoke(Object, Object[]) (at /Applications/buildAgent/work/84669f285f6a667f/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView:Invoke(String, Object) (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\GUI\DockArea.cs:234)
    UnityEditor.HostView:Invoke(String) (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\GUI\DockArea.cs:227)
    UnityEditor.HostView:OnGUI() (at C:\BuildAgent\work\7535de4ca26c26ac\Editor\Mono\GUI\DockArea.cs:120)

    (Filename: C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/BuildPipeline/PostProcessAndroidPlayer.cs Line: 334)

    Error building Player: UnityException: Resource re-package failed!
    Failed to re-package resources. See the Console for details.

    (Filename: Line: -1)

    System memory in use before: 74.6 MB.
    Unloading 1 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)
    System memory in use after: 73.5 MB.

    Unloading 20 unused Assets to reduce memory usage. Loaded Objects now: 549.
    Total: 6.269845 ms (FindLiveObjects: 0.092669 ms CreateObjectMapping: 0.016903 ms MarkObjects: 1.783363 ms DeleteObjects: 0.147003 ms)


    *** Cancelled 'Build.Player.AndroidPlayer' in 10 seconds

    Begin MonoManager ReloadAssembly
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEngine.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.Graphs.dll (this message is harmless)
    Loading C:\Program Files (x86)\Unity\Editor\Data\Managed\UnityEditor.Graphs.dll into Unity Child Domain
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\I18N.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\I18N.West.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\System.Core.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\System.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Managed\nunit.framework.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Managed\Mono.Cecil.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\System.Xml.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\UnityScript.dll (this message is harmless)
    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Managed\ICSharpCode.NRefactory.dll (this message is harmless)

    ----- Total AssetImport time: 0.012452s, Asset Import: 0.000000s, CacheServerIntegrate: 0.000000s, CacheServer Download: 3493.807129s [0 B, 0.000000 mb/s], CacheServer Hashing: 3493.807129s [Unknown, 4047944704.000000 mb/s]

    Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0\System.Xml.Linq.dll (this message is harmless)
    Mono: successfully reloaded assembly
    - Completed reload, in 0.589 seconds
     
  13. jvil

    jvil

    Joined:
    Jul 13, 2012
    Posts:
    263
    There isn't official patch for the Android SDK issue on Unity 3.x ? (for users which didn't upgraded our licenses to Unity 4)
     
  14. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    I have Unity3D 4 PRO but it doesn't works too :(
     
  15. jvil

    jvil

    Joined:
    Jul 13, 2012
    Posts:
    263
    Read again. I didn't told this didn't worked. Actually it works un-officially, but I want an official solution for 3.x.

    Your issue isn't related with this bug, it's a different case and looking at your previous post it's probably related to a bad java or android-sdk install.
     
  16. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    May be, but I am not so sure about this now becouse I have reinstalled all the environment and the problem is the same..

    Anyway I am waiting for some official unity3D help to close this nightmare.
    I hope Bitter can give me an answer.
     
  17. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,080
  18. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
  19. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    I have installed on a different PC with WinXP a clean environment:

    1) jdk-7u25-windows-i586.exe
    2) installer_r21-windows.exe
    3) UnitySetup-4.1.5.exe (in this PC I have used the FREE version license)

    ...but I have always the same problem!
    I need seriously help because I can't use anymore my Android PRO license.

    I hope some good Unity3D guy will help me to go out from this nightmare.

    Kenshin
     
    Last edited: Jun 24, 2013
  20. AppXP

    AppXP

    Joined:
    Apr 16, 2013
    Posts:
    2
    You try to build sample project.
     
  21. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Just ran into this little nugget when building for gamestick + unity 3.5.7. I'm trying to earn enough money to upgrade unity 4 licenses for pro + droid + ios but it's being a bit of a struggle.

    I'd love to migrate fully but I can't afford it at the moment. Trying to install API 14 via Android SDK Manager atm, hopefully it will go well.
     
  22. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Interesting update! ...I hope will help other people...

    I have found the origin of the problem:
    to an unfortunate coincidence upgrade Unity3D occurred on the same day of activation of the new Windows Server 2012 and I had not put in relation to these two events.

    When I have tried on a different PC it was always under the windows domain controller.

    Today I have tried on a new Win7 PC not connected to the domain and I was able to buld an APK using Unity3D 4.1.5 and Android SDK r22.0.1!
    Then I think is a permission problem for unity3d and java.

    Now the question is: how i can build an APK using a Win7 64bit PC under a windows server domain?

    What is blocking Java called by Unity3D?

    NOTE: domain user is defined as pc administrator then can install and do anything on the pc.
     
  23. elissa-tong

    elissa-tong

    Joined:
    Jun 25, 2013
    Posts:
    9
    Having a similar problem. Installed the SDK using the latest ADT package for windows found at: http://developer.android.com/sdk/index.html

    Downloaded 64 bit: adt-bundle-windows-x86_64-20130522
    Unzipped it: F:\Android\adt\adt-bundle-windows-x86_64-20130522
    Set my Unity -> Preferences -> External Tools -〉Android SDK Location = F:\Android\adt\adt-bundle-windows-x86_64-20130522\sdk
    (where there is a "tools", "build-tools", and "platform-tools" folders)
    Select File --> Build Settings --> selected Android platform and hit Build.
    (tried it with Development Build checked and unchecked)

    Build Error:

    Error building Player: Win32Exception: ApplicationName='java.exe', CommandLine='-Xmx1024M -Dcom.android.sdkmanager.toolsdir="F:/Android/adt/adt-bundle-windows-x86_64-20130522/sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -', CurrentDirectory='F:\SVN\src\MyGame'


    Edit: Got it working, built an apk and ran it successfully on my Android device:
    How to Setup Android:
    1. Download latest Android ADT (this includes eclipse, sdk, and other tools)
    2. Unzip the adt to any local location of your choice.
    3. Open up eclipse/eclipse.exe

    5. Click the Android SDK Manager icon (on the toolbar). Install all tools, all extras, API of your choice. ie: Android 2.1 API 7, Android 2.2 API 8, Android 4.0 (API 14).
    6. Instal JDK 86-bit
    7. Install Android SDK revision 21 (installer_r21-windows.exe). Installs to location: C:\Program Files (x86)\Android\android-sdk
    8. Open the installed Android API in the ADT package location (ie: \adt-bundle-windows-x86_64-20130522\sdk\platforms)
    9. Copy all the API folders to where revision 21's platform folder is located.
    10. Open Unity, go to Edit Unity -> Preferences -> External Tools -> Android SDK Location = <location of revision 21>
     
    Last edited: Jun 28, 2013
  24. cowlinator

    cowlinator

    Joined:
    Mar 15, 2012
    Posts:
    69
    I was having the same problem.
    Code (csharp):
    1.  
    2.     Error building Player: Exception: android (invokation failed)
    3.     ERROR: unknown error
    4.     cmd:android list target -c
    5.     stdout;
    6.     stderr:
    7.     Exception in thread "main" java.lang.NullPointerException
    8.         at SDKMain.main(SDKMain.java:62)
    I tried downgrading to SDK tools r21, but that didn't work. Turns out it wasn't downgrading correctly.

    Here's how I did it:

    Make a backup copy of the tools folder OUTSIDE of the root android folder.
    Use the SDK manager to delete tools, platform tools, and build tools.
    Close the SDK manager.
    Delete the tools folder if necessary.
    Install https://dl.google.com/android/installer_r21-windows.exe.
    Run the SDK manager and install JUST the platform tools (not tools).
     
  25. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    @elissa.tong
    @cowlinator

    What operating systema are you using?

    I think that could be a java problem, also for mine android build problem.
    Because I can compile with Android SDK r22.0.1 and Unity3D 4.1.5 with a Win7 64bit PC but on another PC with the same configuration I can't! :(

    I have this error:
    Code (csharp):
    1.  
    2. package -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk/platforms/android-16\android.jar" -F bin/resources.ap_
    3.  
    May be is a java permission or path problem.

    Will be usefull know what type of call Unity3D do to package the unity build to prepare the .apk file.

    Any feedback from unity3D? ...Bitter please? :)
     
  26. cowlinator

    cowlinator

    Joined:
    Mar 15, 2012
    Posts:
    69
    I'm using Windows 7 Service Pack 1 and Unity 4.1.2f1.

    It looks like you're getting a different error message than everybody else here, Kenshin. It might be a problem which is unrelated to everybody else's. I would suggest creating your own thread.
     
  27. Raigex

    Raigex

    Joined:
    Jul 6, 2012
    Posts:
    154
    I have found that installing the r21 android tools in a seperate folder (thanks for that link btw) and point unity to that folder for my sdk allows me to compile with only the regular problems (keystore wrong etc). Will not be updating until i hear that it is all fixed. (officially).
     
  28. kaz2057

    kaz2057

    Joined:
    Jan 18, 2011
    Posts:
    326
    Error is fixed on 4.2?
     
  29. sushanta1991

    sushanta1991

    Joined:
    Apr 3, 2011
    Posts:
    305

    Thank you Man..
    and for guys who are still facing this problem,
    go to your android sdk folder delete the tool folder that contains the latest r22.
    now download the r21 package from these links
    Windows: http://dl.google.com/android/android-sdk_r21-windows.zip
    Mac OS X: http://dl.google.com/android/android-sdk_r21-macosx.zip

    now extract the downloaded zip, copy the tool folder and past it inside the sdk folder. now follow these instructions

    in my case i didn't downloaded api level 17 so i copied things from api level 18 and things started working like a charm.
    "i am on MAC" :D i am going to write a tutorial, how to setup android on mac because i struggle a lot to find these solution...
     
  30. GilhoKim

    GilhoKim

    Joined:
    Aug 13, 2013
    Posts:
    1
    $123.png

    hi. I am studying unity3d. I hope you solve this problem. Please help me.

    [Development environment.]
    1. window 8 - (x64)
    2. unity3d - 3.5.5f
    3. ADT Bundle for window(x64)
    4. jdk1.7.0_21 (x64)

    Please help me
     
  31. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    @GilhoKim, this issue has been fix in Unity 4. I strongly suggest you upgrade your Unity version. A lot has changed since Unity 3.5.5 was released. New OS versions, new SDK/NDKs, new generation of gpus, new APIs and of course a new set of bugs in drivers and os's which needs to be worked around.
     
  32. jvil

    jvil

    Joined:
    Jul 13, 2012
    Posts:
    263
    What if we bought Unity Pro license and Android Pro for Unity 3.x ? We need to spend a lot of money again only to fix this bug ?

    Because I didn't see any official update/solution for Unity 3.x on all this post (downgrade Android SDK isn't a solution).
     
  33. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    If you can't downgrade the SDK maybe you can copy the files to the 'correct' location? It is highly unlikely we will do another 3.5 release. Official support for 3.5 was dropped by the end of 2012. This doesn't mean that there will never ever be another 3.5 release, it just means the issue has to be very critical and most likely a runtime issue.

    Also, if you do pay for an upgrade I can assure you you will not only benefit of having this particular issue resolved. You will also get access to a ton of other fixes, performance enhancements, features etc.
     
  34. jvil

    jvil

    Joined:
    Jul 13, 2012
    Posts:
    263
    That's the solution I proposed on first page, but this would imply to do the same on each Android SDK update if the files are removed from this folder after update the SDK.

    Anyway, is kind of annoying having a licensed software that should work out of the box without any hack. It's a Pro license, and we're not talking about $10.

    Not fixing this issue (which is critical because If you don't read this post you can't compile with latest Android SDK and Unity 3.x) it's something that highly discourages me to keep the engine updated to latest versions (if requires a payment to major versions).

    I'm not going to update my project to Unity 4 after 11 months working on my project with Unity 3.x, you know all the implications, performance testing (I'm sure will be performance drop after reading a lot of posts on this forum and I don't want to deal with this. I remember performance issues wasn't fixed on Unity 3 until latest updates), broken things, that this could imply on a big project, so basically I'm not going to benefit on any way (I don't require Mecanim and other new tools).
     
  35. PaXLiCh

    PaXLiCh

    Joined:
    Jul 28, 2013
    Posts:
    4
    Our studio bought Unity Pro 3, Android Pro, iOS Pro
    But you still not fixed errors, crashes, a ton of other problems.
    How about "fatal signal 11 (sigsegv)" on android?
    How about crashes when keyboard layout was changed?
    How about freezes on exit?

    Why updates of unity3 throwed so quickly? Why stopped on 3.5.7? Why not on 3.4? Why not on 3.1?
    Support of version 3 was shorter than the development of our little game!!!

    We don't want to buy other glitchfull unity4 for 2k. With new bugs, not tested, with bad compability, without support of armv6.

    You are deceive those who bought version 3. so you deceive and those who bought version 4.
    THIS IS A REAL RIP-OFF!

    Defective product. must be returned to the seller with the refund.
     
  36. asifn20

    asifn20

    Joined:
    Dec 10, 2012
    Posts:
    1
    THANK YOU very much for the solution JVIL it did work for me too...:) is an easier job than downgrading to r21
     
  37. NaumanH

    NaumanH

    Joined:
    Jul 10, 2012
    Posts:
    8
    This worked, thanks alot, was got nuts from 3 days.
     
  38. cyrillegedoria

    cyrillegedoria

    Joined:
    Oct 16, 2013
    Posts:
    1

    Thank You :)
     
  39. Nerovingian

    Nerovingian

    Joined:
    Nov 13, 2013
    Posts:
    1
    Hay i already try everythings but seems error still same Error building Player: Win32Exception: ApplicationName='E:/Albi's Documents/ar/android-sdk-windows\platform-tools\adb.exe', CommandLine='start-server', CurrentDirectory='E:/Albi's Documents/ar/android-sdk-windows' Please help me. . !!!
     
  40. WarpZone

    WarpZone

    Joined:
    Oct 29, 2007
    Posts:
    326
    It may have been fixed in Unity 4, but it's broken again in Unity 4.3.4.

    Edit: Fixed. Now unsure if this error is Unity's fault or not. Actually I'm unsure if it's even what this thread is about. (I got here by googling "Error: Debug Certificate expired" + unity3d)

    Anyway, the fix, (for anyone else who googles themselves here in the distant future such as three months from now,) was to delete the old security certificate, which was in a hidden directory. Unity generated a new one the next compile.
     
    Last edited: Mar 11, 2014
  41. Turbine

    Turbine

    Joined:
    Nov 9, 2012
    Posts:
    11
    Reviving dead thread because I'm getting the same error in Unity 4.3.3f1 BUT the above solution does NOT work for me.
     
  42. SimonPan

    SimonPan

    Joined:
    Sep 4, 2014
    Posts:
    1
    Thank you jvil! This worked for me as well.
     
  43. Ardito

    Ardito

    Joined:
    Feb 24, 2013
    Posts:
    10
    Thanks! Work!!
     
  44. aalmada

    aalmada

    Joined:
    Apr 29, 2013
    Posts:
    21
    2 years after this thread started why am I getting this same error in Unity 5.1.1f1?

    Error building Player: Win32Exception: ApplicationName='D:/Android/sdk\tools\aapt.exe', CommandLine='package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "D:/Android/sdk\platforms\android-22\android.jar" -F bin/resources.ap_', CurrentDirectory='Temp/StagingArea'