Unable to list target platforms when building on Android (2017.3.1f1)

I’m getting this error when I try to build an app for Android. I have tried various suggestions on the web such as installing JDK8 instead of JDK9, and installing an older version of the tools, but none of them work.

Can someone help me, please? I really need to build a release. The error is as follows:


CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct.

C:\Users\x\AppData\Local\Android\Sdk ools\bin\avdmanager.bat list target -c

stderr[
Exception in thread “main” java.lang.NoSuchMethodError: com.android.prefs.AndroidLocation.getAvdFolder()Ljava/lang/String;
at com.android.sdklib.tool.AvdManagerCli.init(AvdManagerCli.java:278)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:210)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
]
stdout[
]
exit code: 1
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild
(System.String title, System.String
message, System.Exception ex) (at
<388bfc6933e8438da93bcd874bbbeee6>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks
(UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <388bfc6933e8438da93bcd874bbbeee6>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild
(UnityEditor.BuildOptions options,
UnityEditor.BuildTarget target) (at <388bfc6933e8438da93bcd874bbbeee6>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild
(UnityEditor.BuildOptions options,
UnityEditor.BuildTarget target) (at <388bfc6933e8438da93bcd874bbbeee6>:0)
UnityEditor.PostprocessBuildPlayer.PrepareForBuild
(UnityEditor.BuildOptions options,
UnityEditor.BuildTargetGroup
targetGroup, UnityEditor.BuildTarget
target) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:87)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

Three days and no help? Should I report this as a bug to Unity?

I’ve run into the same issue. Can’t find any help on the current version.

I’m in the same boat as well.

Hi guys, @mrpmorris Unity version of 2017 or later are only compatible with SDK 25.2.5 and JDK 1.8.161 (I think). So change your SDK → Tools with 25.2.5 version. If you don’t want to overwrite your tools folder you can rename it to something else. Here is my SDK and JDK you can download and add it to the Unity → Preferences → External Build https://drive.google.com/drive/folders/16n3hvR9JfTaKWW0MGNDhHLc6XIg3agM9?usp=sharing

hope it works on you. Insya Allah. Regards, Ikhsan Syahputra.