Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Cannot Build Android Player with Linear Color Space due to SDK API Issue

Discussion in '2019.2 Beta' started by Ghosthowl, Mar 13, 2019.

  1. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    This issue originally started off as the one seen here. The issue evolved into the one I have now after upgrading from 2019.2.0a4 to 2019.2.0a7.

    Simply open a new project and try to install the Android Component module and then switch color space to 'Linear'. Minimum API Level stays on 'Getting API Levels' and a 'CommandInvokationFailure: Failed to update Android SDK package list.'

    Code (CSharp):
    1. CommandInvokationFailure: Failed to update Android SDK package list.
    2. C:/Program Files/Unity/Hub/Editor/2019.2.0a7/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\tools\bin\sdkmanager.bat --list
    3.  
    4. stderr[
    5. Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    6.     at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    7.     at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    8.     at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    9.     at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    10.     at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
    11. Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    12.     at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    13.     at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    14.     at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    15.     ... 5 more
    16. ]
    17. stdout[
    18.  
    19. ][ICODE][/ICODE]
    20. exit code: 1
    21. [URL='http://unityeditor.android.command.waitforprogramtorun/']UnityEditor.Android.Command.WaitForProgramToRun[/URL] (UnityEditor.Utils.Program p, [URL='http://unityeditor.android.command+waitingforprocesstoexit/']UnityEditor.Android.Command+WaitingForProcessToExit[/URL] waitingForProcessToExit, System.String errorMsg) (at <0a6cfc655e044ab3bce5e6f97fcb5ba1>:0)
    22. [URL='http://unityeditor.android.command.run/']UnityEditor.Android.Command.Run[/URL] (System.Diagnostics.ProcessStartInfo psi, [URL='http://unityeditor.android.command+waitingforprocesstoexit/']UnityEditor.Android.Command+WaitingForProcessToExit[/URL] waitingForProcessToExit, System.String errorMsg) (at <0a6cfc655e044ab3bce5e6f97fcb5ba1>:0)
    23. UnityEditor.Android.SDKManager.UpdatePackagesList () (at <0a6cfc655e044ab3bce5e6f97fcb5ba1>:0)
    24. UnityEditor.Android.SDKManager.ListAvailable (UnityEditor.Android.SDKManager+Component type) (at <0a6cfc655e044ab3bce5e6f97fcb5ba1>:0)
    25. UnityEditor.Android.PlayerSettingsEditorExtension.<StartGettingReleasedAPILevels>m__0 () (at <0a6cfc655e044ab3bce5e6f97fcb5ba1>:0)
    26. System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <7d97106330684add86d080ecf65bfe69>:0)
    27. System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <7d97106330684add86d080ecf65bfe69>:0)
    28. System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <7d97106330684add86d080ecf65bfe69>:0)
    29. System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <7d97106330684add86d080ecf65bfe69>:0)
    30. System.Threading.ThreadHelper.ThreadStart () (at <7d97106330684add86d080ecf65bfe69>:0)
    31. UnityEngine.UnhandledExceptionHandler:<RegisterUECatcher>m__0(Object, UnhandledExceptionEventArgs)
    It appears that there is an issue with the Android SDK in all the new versions of Unity 2019.2.0aX. My issue started off as having a blank 'Minimum API Level' to now having a constant 'Getting API Levels' for both minimum and 'Target API Level'. I have tried using the installed SDK, JDK, NDK and gradle as well as my own custom installation from Android Studio 3.3.2.



    Without this working it is impossible to build the Android Player using 'Linear' color space.



    I have reported this bug with report number - 1136069
     

    Attached Files:

  2. chaevid

    chaevid

    Joined:
    Aug 31, 2018
    Posts:
    1
    I'm having a similar problem.
     
  3. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    @Ghosthowl were you able to resolve this issue on your end?
     
  4. jeanpierrehabimana

    jeanpierrehabimana

    Joined:
    Oct 18, 2017
    Posts:
    1
    Me also I have the same problem in unity 2019.2.0b5, any one can help us please
     
    chaevid likes this.
  5. dominykasm

    dominykasm

    Unity Technologies

    Joined:
    May 27, 2018
    Posts:
    70
    Hi, do you have several JDKs installed on your machine? And what are those versions?
     
  6. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    142
    Install through the UnityHub
     
  7. Matanyos

    Matanyos

    Joined:
    Nov 4, 2016
    Posts:
    12
    please we need solution
    the problem is there
     
  8. PerfectSkies

    PerfectSkies

    Joined:
    Jan 2, 2019
    Posts:
    3

    Just making sure here, did you select the "Android SDK & NDK Tools" from the drop down? I missed it, and thus had this issue...
     
  9. PerfectSkies

    PerfectSkies

    Joined:
    Jan 2, 2019
    Posts:
    3
  10. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    58
    +1

    Same Issue

    CommandInvokationFailure: Failed to update Android SDK package list.
    D:/Work/Softwares/Unity/2019.2.0b9/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\tools\bin\sdkmanager.bat --list
     
    Last edited: Jul 14, 2019
    ROBYER1 likes this.
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
  12. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    106
    So will downgrading the jdk (to 8 or below) fix this issue in all cases?
     
  13. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Yes, downgrading to 8 is a workaround until we deploy a fix.
     
  14. mlea_unity

    mlea_unity

    Joined:
    Oct 1, 2018
    Posts:
    5
    Downgrading did not fix for me. Please advise another work around(Sorry if this posts twice, something weird happened)
     
  15. mlea_unity

    mlea_unity

    Joined:
    Oct 1, 2018
    Posts:
    5
    Okay so I did have to go back and upgrade all my latest Android SDK tools as well and drop back to JDK 8. That got me past this. Thanks
     
  16. vjyourself

    vjyourself

    Joined:
    Dec 6, 2016
    Posts:
    6
    I have this issue too ... Downgraded to JDK 8, and still having it.
    For me the whole Player Settings dialog is empty, so I can't setup a new project.
    Shame on the Unity Team to breaking my Android VR workflow all the time.
     

    Attached Files:

    parapabarba likes this.
  17. parapabarba

    parapabarba

    Joined:
    Aug 27, 2017
    Posts:
    1
    Hello, I have the same problems as vjyourself. I have downgraded to JDK8 and still have the problem.


    CommandInvokationFailure: Failed to update Android SDK package list.
    /Applications/Unity/Hub/Editor/2019.2.0f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --list


    Edit:
    Right, after reading LandonHughes success, I tried to reproduce his success. It did not work on my mac. I changed the Java version to 8 and restarted and still version 10.

    I followed this advice on SO and it works now
    https://apple.stackexchange.com/a/325822
     
    Last edited: Aug 14, 2019
  18. LandonHughesLLC

    LandonHughesLLC

    Joined:
    Feb 18, 2016
    Posts:
    6
    This is ridiculous. I thought I'd be able to finish up my project today. NOPE. Unity decided it could no longer find the Android SDK.

    Edit: 8/14/19 - 3:48pm EST...To fix the problem, leave everything in Unity as it is.

    1. If you have Java on your computer installed, type in "apps & features" then uninstall everything Java related including the JDK, JRE, etc. (Android studio is fine).

    2. Then go to this: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html and download the JDK that fits your computer.

    3. Close Unity.

    4. Restart your PC

    5. Go to Unity and your problem SHOULD be fixed!!
     
    Last edited: Aug 14, 2019
    parapabarba likes this.
  19. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    This will be fixed in 2019.2.2f1
     
  20. luengor

    luengor

    Joined:
    Jul 21, 2017
    Posts:
    1
    Ok, I had the same problem and after downgrading the jdk and building the apk the problem fixed
     
  21. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    As a temporal solution you can manually edit ProjectSettings.asset and set Android Sdk Version by hands
    Code (CSharp):
    1.   AndroidMinSdkVersion: 18
    2.   AndroidTargetSdkVersion: 28
     
  22. chLim

    chLim

    Joined:
    Jul 17, 2017
    Posts:
    5
    In Unity2019.2.2 still happens! I've installed a module Unity had provided, but it's still there
     
  23. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    I'm still getting this issue on Unity2019.2.2f1. I also tried to use SDK from Android Studio but the issue persists.
    I even tried adding OpenJDK installed from Unity Editor to JAVA_HOME path, but no success.
     
  24. CD-ECEU

    CD-ECEU

    Joined:
    May 21, 2019
    Posts:
    7
  25. INCISIV

    INCISIV

    Joined:
    Aug 23, 2018
    Posts:
    1
    Still having the same issue here as well. Unity 2019.2.2
     
  26. JCereda

    JCereda

    Joined:
    Aug 29, 2019
    Posts:
    3
    I had the same problem, but somehow It got fixed after building with a default configuration. Not sure if it worked after installing and building with the 2018 LTS editor.
     
  27. NGC6543

    NGC6543

    Joined:
    Jun 3, 2015
    Posts:
    228
    I tried Unity2019.2.3f1 yesterday and this issue no longer happens.
    But I'm curious, if I use Android SDK Tools installed with Unity (which is recommended), build fails saying that the target SDK version is not installed. So, unless I use the exact SDK version the OpenJDK has, I'll have to use one from Android Studio instead.
     
  28. Boy2000

    Boy2000

    Joined:
    Aug 21, 2019
    Posts:
    8
    I have it but still!!!!!!!!!!!!!
     
  29. Boy2000

    Boy2000

    Joined:
    Aug 21, 2019
    Posts:
    8
    It's still a problem please fix it... I've sent a bug report but nothings changed
     
  30. jingels

    jingels

    Joined:
    Aug 28, 2019
    Posts:
    1
    I've got Unity 2019.2.3f1 Personal and the issue is still happening.
    Code (CSharp):
    1. CommandInvokationFailure: Failed to update Android SDK package list.
    2. C:/Program Files/Unity/Hub/Editor/2019.2.3f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\tools\bin\sdkmanager.bat --list
     
  31. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    244
    +1
    happens in 2019.2.3f1
     
  32. Skalbe

    Skalbe

    Joined:
    Feb 8, 2017
    Posts:
    5
    What a joke.
     
  33. heweiwei

    heweiwei

    Joined:
    Apr 5, 2016
    Posts:
    3
    +1
    happens in Unity 2019.2.12f1
     
  34. markgrammer

    markgrammer

    Joined:
    Nov 5, 2015
    Posts:
    2
    +1 2019.2.13f1
    It's a repeat install after multiple previous+simultaneous installs in the Hub.
    I have a lab of 30 computers with DeepFreeze installed (computers reset after logout unless thawed)
     
  35. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    +1 2019.2.13f1
    I'm going mad for three days with android builds continuosly failing with many different issues, anyway at the moment the error is:


    Errore: impossibile trovare o caricare la classe principale com.android.sdklib.tool.SdkManagerCli
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    CommandInvokationFailure: Failed to update Android SDK package list.
    C:/Program Files/2019.2.13f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\tools\bin\sdkmanager.bat --list
    stderr[
    Errore: impossibile trovare o caricare la classe principale com.android.sdklib.tool.SdkManagerCli
    ]
    stdout[
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEditor.Android.SDKManager.UpdatePackagesList () (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEditor.Android.SDKManager.HighestVersionInstalled (UnityEditor.Android.SDKManager+Component tool) (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKToolsDetector.GetVersion () (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Detect (System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress) (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector detector) (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <13e769c2760a442eaf6dff80696716f1>:0)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    Build completed with a result of 'Failed'
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:95
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)


    The API levels on Player Settings just display "Getting API levels...". I've Java 8 update 231 installed.

    I'm also attaching the full editor log of my last build attempt.
     

    Attached Files:

  36. MJonee

    MJonee

    Joined:
    Oct 19, 2013
    Posts:
    20
    Also had this problem in 2019.3.7f1
    Solved by uninstalling java 10 and installing java 8. Thanks!
     
  37. Finkes

    Finkes

    Joined:
    Jun 17, 2014
    Posts:
    4
    also having this issue in Units 2019.3.13f1 on Mac OS. Is there still no other solution for this issue besides downgrading to Java 8?