After VS2017 update, Android Device Manager doesnt work

adamgodleyadamgodley GBMember ✭✭

Working within quite a restrictive company proxy, I updated visual studio 2017. Since that time, when I run Android SDK Manager, it cannot access the Microsoft Repository, though the Google repository works. When I try Android Device Manager, an error pops up with "Android SDK instance could not be loaded. Please check your internet connection."

It seems very likely to me that some attempt to connect outwards is being blocked by my proxy, but I cannot find out what url this is. Does anyone know?

Ta!

Answers

  • Saraswati_ChandraSaraswati_Chandra USMember ✭✭✭

    Visual Studio => Go To Tools=> Options=>Xamarin=>Android.
    Check that the location for your sdk and ndk are correct.
    I not then give the correct path.

    Hope it helps!!

  • adamgodleyadamgodley GBMember ✭✭

    These settings are correct. The managers both run, as i said above, but its clear they are trying to access something that my proxy is refusing. I need to understand what this is.

  • ShafiqJethaShafiqJetha CAMember ✭✭
    edited June 2018

    Did you get any further with this, Adam? I'm having the same issue myself.

  • ShafiqJethaShafiqJetha CAMember ✭✭

    Hi all,

    I uninstalled Visual Studio 2017 preview and restarted the stable install of Visual Studio, tried to access the Android Device Manager again and was successful. It seems that if the Android SDK is installed for the Stable release and not the preview, that it will fail when accessed from the stable release.
    Sounds like a bug to me.

  • BrianConradBrianConrad USMember ✭✭
    edited June 2018

    Definitely a bug. When I create a new device in the Android Device Manager I get this:

    Device error: emulator: ERROR: Unknown AVD name [mydevice], use -list-avds to see valid list.
    ANDROID_SDK_HOME is defined but there is no file mydevice.ini in $ANDROID_SDK_HOME\avd
    (Note: Directories are searched in the order $ANDROID_AVD_HOME, $ANDROID_SDK_HOME\avd and $HOME\.android\avd)
    

    Problem is that "mydevice.ini" is in the avd folder. I also made sure that all those environment variables were correct. It seems that though the device manager used in VS creates and saves the emulator it's looking in the wrong place to start it. And I don't know what sets that $HOME.android\avd because it doesn't show up in the variable list.

    To further sleuth this I did a search to find all the AVD Manager.exe's on my hard drive. Four were found but I don't which one is being used by VS. We need a little more information as to which one is being run. There's been a lot of changes since I first started developing Android apps using Xamarin with the state and location of the emulators. They changed things recently due to Google's use of a command line and Microsoft has it's own repository for the SDK and emulators.

    I also uninstalled Mobile Development .NET for VS and reinstalled hoping that would help but it didn't. Seems like the default location for the VS AVD Manager would be the one in the C:\ProgramData\Microsoft\AndroidSDK\\tools\lib folder.

    Then we have the emulator troubleshooting page:
    https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/troubleshooting?tabs=vswin

    If you double click on the link as given another instance of VS pops which does nothing. What you want is a text editor for the user.config file. And be sure to use the correct path not the example given. But that didn't seem to help either.

    I'm sure I'll sort this out and get VS running properly again with emulators I need but this has created a couple days of delay for a product release already. If I sort it out I report my solution.

    PS: I found the path to the device manager that VS is now using on my machine:
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Xamarin\AndroidDeviceManager\AndroidDevices.exe

  • BrianConradBrianConrad USMember ✭✭

    I did away with the environment variables and emulators are working again. Apparently the VS AndroidDevices manager didn't need them and they were throwing it off. However I will say that some of the documentation on setting up Android emulators and what's changed seems to contradict itself from page to page. Those needs to be reviewed and corrected and some if not all were updated at the start of the month.

    Environment variables always seem like a throwback to DOS and one is never sure exactly what is needed for the path, either the folder itself or the above it.

    1. Disabled xamarin Extension
    2. Restart VS
    3. Reload droid project
    4. Enabled Xamaring Extension
    5. Restart VS

    This worked for me

  • Disable internet connection
    open android device manager
    start your emulator device
    enable internet connection again

  • EdwardKEdwardK Member

    I had the same problem

    seems that there were errors in the configuration that can be fixed using
    edit option inside the new avd manager . The wrong settings will have a exclamation mark.

    I had to change the "wrong" sdcard size setting value from "512 MB" to "512M", save it , wait for the image is downloaded again, and then I could start the emulator. I had also to reinstall everything on the image.

    why do we need two different avd managers vs2017, and android studio anyway?

Sign In or Register to comment.