Android SDK Manager complains with "Loading SDK component information failed" in VS2017

Hello

I would like to build mobile apps using Xamarin and Visual Studio 2017 Enterprise (15.8.4). I therefor followed Microsofts documentation on installing the whole stack. I choose the Mobile Development with .NET workload from the installer, expecting it to pull in all the necessary dependencies.

Unfortunately when I try to launch the Android SDK Manager from within Visual Studio i get Loading SDK component information failed. Please retry.

What I have tried so far:

  • Repairing VS
  • Launching VS as local admin
  • Reinstalling the AndroidSDK/NDK and Xamarin packages

What am I doing wrong?

Answers

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    @matze2ooo

    Can you double check to ensure that the Android SDK within Visual Studio has a proper path defined? You can find this by going to Tools > Options > Xamarin > Android Settings.

    Additionally, you should have logs found in Help > Xamarin > Zip Logs that you can attach here and we can look at what's going on.

    Thanks!

  • matze2ooomatze2ooo Member ✭✭

    Hi Jon, thanks for your reply.

    I think the defined path should be fine. Please see attached screenshot (can post links yet...)

    It seems that Xamarin isnt logging anything when clicking on "Tools > Android > Android SDK Manager", but maybe you can find another hint within logs. Please find them attached.

    Interesstingly when starting the sdkmanager.exe manually (non evaluated) from "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Xamarin\AndroidSdkManager" it works!!

    I have posted more information on stackoverflow, unfortunately I cant post links yet...

    Thanks a lot for any further hint on how to solve this.

  • matze2ooomatze2ooo Member ✭✭

    Ah finally some more information from *ide.log.

    Xamarin.VisualStudio.Android.XamarinAndroidPackage|Warning|0|Initializing Xamarin.VisualStudio.Android.XamarinAndroidPackage
    Xamarin.VisualStudio.UnhandledExceptionsManager|Error|0|An unhandled error occurred. Details: Value cannot be null.
    Parameter name: versions

    System.ArgumentNullException: Value cannot be null.
    Parameter name: versions
    at Xamarin.Android.Tools.AndroidSdkInfo.GetInstalledPlatformVersions(AndroidVersions versions) in E:\A_work\122\s\External\androidtools\external\xamarin-android-tools\src\Xamarin.Android.Tools.AndroidSdk\AndroidSdkInfo.cs:line 81
    at Xamarin.AndroidTools.AndroidSdk.GetInstalledPlatformVersions(AndroidVersions versions) in E:\A_work\122\s\External\androidtools\Xamarin.AndroidTools\AndroidSdk.cs:line 485
    at Xamarin.AndroidTools.AndroidSdk.TrackApiLevels(Dictionary`2 telemetryProperties) in E:\A_work\122\s\External\androidtools\Xamarin.AndroidTools\AndroidSdk.cs:line 329
    at Xamarin.AndroidTools.AndroidSdk.<>c.b__5_0() in E:\A_work\122\s\External\androidtools\Xamarin.AndroidTools\AndroidSdk.cs:line 86
    at System.Threading.Tasks.Task.InnerInvoke()
    at System.Threading.Tasks.Task.Execute()

  • matze2ooomatze2ooo Member ✭✭
    edited September 2018

    Also when trying to start Android Device Manager, the window pops up, but then vanishes after a second or so.

    If I understand the above exception correctly then the Xamarin.Android extension is not able to get information about the installed AndroidSDK versions on my system.

    I have attached the output of "C:\Program Files (x86)\Android\android-sdk\tools\bin>sdkmanager --list"

    I also realized that a couple of licenses hadnt been accepted. So I ran "sdkmanager --licenses" elevated and accepted all of them. However it did not make a change from within visual studio to the aforementioned problem.

    Maybe there is some environment variable missing?

  • matze2ooomatze2ooo Member ✭✭

    Here is the link to the relevant class "AndroidSdkInfo.cs" that throws the above mentioned error. It seems that the parameter "version" is null and therefore it throws a ArgumentNullException

    https://github.com/xamarin/xamarin-android-tools/blob/9e78d6ee586b498d0ea082b3bc00432c23583dd1/src/Xamarin.Android.Tools.AndroidSdk/AndroidSdkInfo.cs#L81

  • bunty29985bunty29985 Member
    edited March 21

    I'm running to the same issue on Windows 2012 R2 server (VS 2017 Enterprise 15.9.9). Logs attached

  • matze2ooomatze2ooo Member ✭✭
    I "solved" this issue by reinstalling Windows 10. Maybe deleting my user profile would have been enough. Something with my Visual Studio installation was seriously messed up...
Sign In or Register to comment.