Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Unity 2017.3.1f1 CommandInvokationFailure: Unable to list target platforms.

Discussion in 'Editor & General Support' started by Xeinix, Feb 8, 2018.

  1. Xeinix

    Xeinix

    Joined:
    Aug 19, 2017
    Posts:
    2
    Hey there, I have tried everything I can find. I've tried reinstalling the SDK and some other stuff. There has to be something I'm not doing or seeing. Whenever I try to export to an APK I get 4 errors. I'm not really sure what to do at this point so i you guys have any suggestions that would be greatly helpful.

    This is the main error.

    CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct.
    C:/sdk\tools\bin\avdmanager.bat list target -c

    stderr[
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
    at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
    Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
    ... 5 more
    ]
    stdout[

    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunAndroidSdkTool (System.String toolName, System.String arguments, Boolean updateCommand, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.ListTargetPlatforms (UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit)
    UnityEditor.Android.AndroidSDKTools.GetTopAndroidPlatformAvailable (UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKPlatformDetector.GetVersion (UnityEditor.Android.AndroidSDKTools sdkTools)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Detect (UnityEditor.Android.AndroidSDKTools sdkTools, System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.SDKComponentDetector detector)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (Int32 minVersion, UnityEditor.Android.PostProcessor.Tasks.SDKComponentDetector detector)
    UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext
     
  2. arjunaskykok

    arjunaskykok

    Joined:
    Feb 6, 2018
    Posts:
    4
    jserrano likes this.
  3. arjunaskykok

    arjunaskykok

    Joined:
    Feb 6, 2018
    Posts:
    4
  4. Xeinix

    Xeinix

    Joined:
    Aug 19, 2017
    Posts:
    2
  5. elblogdelbeto

    elblogdelbeto

    Joined:
    Oct 28, 2016
    Posts:
    1
    También me funcionó muchas gracias!!
     
  6. jserrano

    jserrano

    Joined:
    Apr 5, 2018
    Posts:
    1
    what jdk are you using? Last version 8 (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) ? The jdk path should be this one, not AndroidStudio stuff right?

    I tried this method several times but still doesn't work, can som1 do a step by step tutorial how to get this working? Stack and Forums aren't helping...
     
  7. asethi

    asethi

    Joined:
    Jul 24, 2012
    Posts:
    16
    For me with latest Android build tools and latest JDK worked with 2017.x and 2018.1x / 2018.2x versions by setting JAVA_HOME and below ANDROID_HOME paths.

    set ANDROID_HOME=C:\ installation location \android-sdk

    set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
     
    blamapps18 likes this.
  8. twin_digital

    twin_digital

    Joined:
    Jul 26, 2018
    Posts:
    6
  9. blamapps18

    blamapps18

    Joined:
    Jan 16, 2019
    Posts:
    3

    Worked for me! I set environment variables and this solution worked even without restarting Windows 10