Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Android] java.lang.NoSuchMethodError: com.android.prefs.AndroidLocation.getAvdFolder()

Discussion in 'Unity Cloud Build' started by pixelsplit, Nov 21, 2017.

  1. pixelsplit

    pixelsplit

    Joined:
    Sep 16, 2013
    Posts:
    132
    Hi,

    we are now getting the following error: java.lang.NoSuchMethodError: com.android.prefs.AndroidLocation.getAvdFolder()

    It seems like the SK wouldn't be installed correctly or something?

    Here is the log around the error:
    Code (CSharp):
    1. 9498: [Unity] UnityEditor.CloudBuild.Builder:Build()
    2. 9499: [Unity] CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
    3. 9500: [Unity] /APPLICATION_PATH/Android Studio.app/sdk/tools/bin/avdmanager list target -c
    4. 9501: [Unity] stderr[
    5. 9502: [Unity] Exception in thread "main" java.lang.NoSuchMethodError: com.android.prefs.AndroidLocation.getAvdFolder()Ljava/lang/String;
    6. 9503: [Unity] ]
    7. 9504: [Unity] stdout[
    8. 9505: [Unity] ]
    9. 9506: [Unity] exit code: 1
    10. 9507: [Unity]   at UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x00000] in <filename unknown>:0
    11. 9508: [Unity]   at UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x00000] in <filename unknown>:0
    12. 9509: [Unity]   at UnityEditor.Android.AndroidSDKTools.RunAndroidSdkTool (System.String toolName, System.String arguments, Boolean updateCommand, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) [0x00000] in <filename unknown>:0
    13. 9510: [Unity]   at UnityEditor.Android.AndroidSDKTools.ListTargetPlatforms (UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit) [0x00000] in <filename unknown>:0
    14. 9511: [Unity]   at UnityEditor.Android.AndroidSDKTools.GetTopAndroidPlatformAvailable (UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit) [0x00000] in <filename unknown>:0
    15. 9512: [Unity]   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSdk+SDKPlatformDetector.GetVersion (UnityEditor.Android.AndroidSDKTools sdkTools) [0x00000] in <filename unknown>:0
    16. 9513: [Unity]   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSdk+SDKComponentDetector.Detect (UnityEditor.Android.AndroidSDKTools sdkTools, System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress) [0x00000] in <filename unknown>:0
    17. 9514: [Unity]   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSdk.EnsureSDKComponentVersion (System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.SDKComponentDetector detector) [0x00000] in <filename unknown>:0
    18. 9515: [Unity]   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSdk.EnsureSDKComponentVersion (Int32 minVersion, UnityEditor.Android.PostProcessor.Tasks.SDKComponentDetector detector) [0x00000] in <filename unknown>:0
    19. 9516: [Unity]   at UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSdk.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x00000] in <filename unknown>:0
    20. 9517: [Unity]   at UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) [0x00000] in <filename unknown>:0
    21. 9518: [Unity] UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
    22. 9519: [Unity] UnityEditor.CloudBuild.Builder:Build()
    Best regards
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,476
  3. pixelsplit

    pixelsplit

    Joined:
    Sep 16, 2013
    Posts:
    132
    Last edited: Nov 22, 2017
  4. pixelsplit

    pixelsplit

    Joined:
    Sep 16, 2013
    Posts:
    132
  5. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    164
    Same issue with 2017.2.0p2, going back to p1 fix it
     
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,476
    That issue you linked to should've been already fixed... not sure if its back or whats the current status..
     
  7. willisp

    willisp

    Joined:
    Sep 29, 2016
    Posts:
    2
    I'm glad to see I'm not the only one having this error, I'm observing the same on our Cloud Build Agent running Unity 2017.2.0p2.
    Unfortunately, we can't go back to p1 since p2 is fixing important bugs for us.

    I guess we don't have other choice but waiting for a bug fix from Unity.
     
  8. berkhulagu

    berkhulagu

    Joined:
    Sep 6, 2017
    Posts:
    11
    We are experiencing this issue in UCB as well, running 2017.2.0p2. UCB works for the same project on 2017.2.0p1.

    Local builds are fine in 2017.2.0p2.
     
  9. fbrescia

    fbrescia

    Joined:
    Apr 26, 2016
    Posts:
    3
  10. rzubek

    rzubek

    Joined:
    Aug 21, 2014
    Posts:
    58
    Running into this as well with cloud build on 2017.2.0p2

    We're trying to build against Android SDK 21, and it's a problem because:
    - 2017.2.0f3 fails to build with Android SDKs 21-23 (presumably bug #956658 ?)
    - 2017.2.0p2 fixes that build bug, but fails on UCB with the "can't list target platforms" error
     
  11. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,110
    Oh cool. So I'm not going insane. Rolling back to p1 for now...
     
  12. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    164
    Has anyone raised a bug?
     
  13. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,110
    Yep, they're working on it. Hopefully fixed in the next few days.
    Seems to be a build tools update issue.
     
  14. fbrescia

    fbrescia

    Joined:
    Apr 26, 2016
    Posts:
    3
    Bump,
    the issue still remains when trying to build for Android platform on UCB 2017.2.0p3.
     
  15. redstonegames

    redstonegames

    Joined:
    Sep 19, 2015
    Posts:
    11
    For god's sake. When Unity allow us to build for Android without having to downgrade?
    This is just irresponsible and ridiculous.
     
    shottogan and pixelsplit like this.
  16. nerdnils

    nerdnils

    Joined:
    Dec 7, 2017
    Posts:
    36
    Same problem here!
     
    shottogan likes this.
unityunity