Search Unity

  1. Unity 2019.2 is now released.
    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:
    176
    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:
    1,580
    @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:
    50
    Hi, do you have several JDKs installed on your machine? And what are those versions?
     
  6. richardzzzarnold

    richardzzzarnold

    Joined:
    Aug 2, 2012
    Posts:
    69
    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:
    53
    +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:
    1,580
  12. pccross

    pccross

    Joined:
    Jun 20, 2015
    Posts:
    87
    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:
    1,580
    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:
    3
    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:
    1,580
    This will be fixed in 2019.2.2f1
     
  20. Rapido249

    Rapido249

    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:
    59
    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:
    1
    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:
    197
    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:
    3
  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:
    2
    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:
    197
    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:
    179
    +1
    happens in 2019.2.3f1
     
  32. Skalbe

    Skalbe

    Joined:
    Feb 8, 2017
    Posts:
    4
    What a joke.