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()