Reputation: 69
I am new in Unity and created my first Unity game for Android. When I try to build the .apk file, it shows me this error:
Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. C:/Program Files/Java/jdk-9\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:\Users\PC\AppData\Local\Android\Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
External tools Android
sdk : C:\Users\PC\AppData\Local\Android\Sdk
jdk : C:/Program Files/Java/jdk-9
After downloading the android sdk tools_r25.2.3 and replacing the old tools folder inside Android SDK folder i have those errors :
UnityException: Resource compilation failed! Failed to recompile android resource files. See the Console for details. UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message) UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuildPointToConsole (System.String title, System.String message) UnityEditor.Android.PostProcessor.Tasks.BuildResources.CompileResources (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.Tasks.BuildResources.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry) UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args) UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:176) UnityEditor.HostView:OnGUI()
Failed to compile resources with the following parameters: -bootclasspath "C:/Users/PC/AppData/Local/Android/sdk\platforms\android-25\android.jar" -d "C:\Users\PC\Documents\Jack-The-Giant-Remake\Jack The Giant Remake\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding UTF-8 "com\google\android\gms\R.java" "com\google\unity\R.java" "com\Tester\R.java" warning: [options] source value 1.6 is obsolete and will be removed in a future release warning: [options] target value 1.6 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. 3 warnings
UnityEditor.HostView:OnGUI()
I need help please
Upvotes: 0
Views: 1047
Reputation: 491
I had the same problem so right now I'm using Unity v2017.1.1f1 and I fixed this by downloading the android sdk tools_r25.2.3 and replacing the old tools folder inside Android SDK folder (note: don't remove the old tools folder of Android sdk).
Upvotes: 1