Inspector thinks AVD is a physical device and will not load

DarrenKayDarrenKay GBUniversity ✭✭

I'm using the Android SDK emulator with a x86 system image and VS 2017. When I try to use the latest version of the Inspector I get an error launching it; "Inspector is not supported on physical Android devices".

I'm debugging the app fine with the emulator.

Answers

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    That's interesting, I haven't seen that behavior before.

    How did you start your emulator?

    If you quit the emulator and let VS start it when you begin debugging, does the error go away?

  • DarrenKayDarrenKay GBUniversity ✭✭

    I start via cmd starting it from the android sdk directory.
    VS2017 recognises as soon as it starts and selects it as the default device to debug on in the toolbar

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    If you quit the emulator and let VS start it when you begin debugging, does the error go away?

  • DarrenKayDarrenKay GBUniversity ✭✭

    VS does not show any google emulator AVDs in the drop down, I have to launch them from the AVD manager or cmd line

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    @DarrenKay that is probably the heart of the issue, then. I'll ask the VS team if they're familiar with this sort of problem.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    @DarrenKay

    How are you creating the emulator? avdmanager CLI tooling? Or AVD Manager GUI tooling? Please note that Google did deprecate their AVD Manager GUI tool and the preferred method of creating AVDs is through the avdmanager CLI tooling.

    https://gist.github.com/JonDouglas/9eed5704d4601196435bf169620d3186

    I have seen a similar issue with Visual Studio if you have an old emulator created by the AVD Manager GUI and then create new emulators using the avdmanager CLI. I haven't quite pinned it down yet, but can you please try to remove all AVDs from your machine and then re-create them using avdmanager CLI or Android Studio?

  • DarrenKayDarrenKay GBUniversity ✭✭

    I created them using the Google AVD Manager but they don't show up in VS2017 drop down.
    I can launch from the AVD Manager but use cmd line to change DNS/Proxy settings based on testing

  • AlanClarkAlanClark USForum Administrator, Xamarin Team Xamurai

    Hi @DarrenKay

    As Jon advised, the older GUI AVD Manager is deprecated and no longer supported by Google. Using the older tooling for creating Android AVD devices can cause problems with the latest Xamarin tooling. As such we would recommend updating your Android SDK Tools to version >26.

    Please try updating your Android SDK Tools and creating the AVD over the CLI interface (or Android Studio if you have it installed) and see if the AVD appears in the list.

  • DarrenKayDarrenKay GBUniversity ✭✭
    edited December 6

    Used the Xamarin SDK Updater to update the Android SDK and Tools to 26 but the missing the avdmanager.exe command to create a new AVD. Found it. I now have two versions of the emulator so not sure which one VS is set to use.

  • DarrenKayDarrenKay GBUniversity ✭✭

    Looks like the SDK is now messed up, error trying to create an AVD

    `C:\Program Files (x86)\Android\android-sdk\tools\bin>avdmanager create avd -n HHT_Device -k "system-images;android-23;google_apis;x86"

    Warning: Observed package id 'add-ons;addon-unknown-unknown-23' in inconsistent location 'C:\Program Files (x86)\Android\android-sdk\add-ons\addon-google_apis-google-23' (Expected 'C:\Program Files (x86)\Android\android-sdk\add-ons\addon-unknown-unknown-23')

    Warning: Observed package id 'platform-tools' in inconsistent location 'C:\Program Files (x86)\Android\android-sdk\platform-tools.old976448402' (Expected 'C:\Program Files (x86)\Android\android-sdk\platform-tools')

    Warning: Already observed package id 'platform-tools' in 'C:\Program Files (x86)\Android\android-sdk\platform-tools'. Skipping duplicate at 'C:\Program Files (x86)\Android\android-sdk\platform-tools.old976448402'

    Warning: cvc-pattern-valid: Value 'default' is not facet-valid with respect to pattern 'armeabi|armeabi-v7a|arm64-v8a|x86|x86_64|mips|mips64' for type 'abiType'.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 399; cvc-pattern-valid: Value 'default' is not facet-valid with respect to pattern 'armeabi|armeabi-v7a|arm64-v8a|x86|x86_64|mips|mips64' for type 'abiType'.
    `

  • DarrenKayDarrenKay GBUniversity ✭✭
    edited December 6

    I've removed the old SDK from the machine, installed the latest google command line only SDK tools. Installed a platform in SDK and updated SDK so all the tools are in place. VS 2017 recognises the new SDK tools and the SDK has installed some more platforms successfully. Try to create a new AVD;

    C:\Program Files (x86)\Android\android-sdk\tools\bin>avdmanager create avd -f -n HHT_Device -k "system-images;android-23;google_apis;x86"
    Warning: cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[a-zA-Z0-9_-]+' for type 'idType'.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 317; cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[a-zA-Z0-9_-]+' for type 'idType'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    Warning: cvc-type.3.1.3: The value '' of element 'id' is not valid.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 317; cvc-type.3.1.3: The value '' of element 'id' is not valid.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    Warning: cvc-pattern-valid: Value 'default' is not facet-valid with respect to pattern 'armeabi|armeabi-v7a|arm64-v8a|x86|x86_64|mips|mips64' for type 'abiType'.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 363; cvc-pattern-valid: Value 'default' is not facet-valid with respect to pattern 'armeabi|armeabi-v7a|arm64-v8a|x86|x86_64|mips|mips64' for type 'abiType'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    Warning: cvc-type.3.1.3: The value 'default' of element 'abi' is not valid.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 363; cvc-type.3.1.3: The value 'default' of element 'abi' is not valid.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    Warning: cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[a-zA-Z0-9_-]+' for type 'idType'.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 320; cvc-pattern-valid: Value '' is not facet-valid with respect to pattern '[a-zA-Z0-9_-]+' for type 'idType'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    Warning: cvc-type.3.1.3: The value '' of element 'id' is not valid.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 320; cvc-type.3.1.3: The value '' of element 'id' is not valid.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    Warning: cvc-pattern-valid: Value 'default' is not facet-valid with respect to pattern 'armeabi|armeabi-v7a|arm64-v8a|x86|x86_64|mips|mips64' for type 'abiType'.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 399; cvc-pattern-valid: Value 'default' is not facet-valid with respect to pattern 'armeabi|armeabi-v7a|arm64-v8a|x86|x86_64|mips|mips64' for type 'abiType'.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    Warning: cvc-type.3.1.3: The value 'default' of element 'abi' is not valid.
    org.xml.sax.SAXParseException; lineNumber: 145; columnNumber: 399; cvc-type.3.1.3: The value 'default' of element 'abi' is not valid.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

    Auto-selecting single ABI default=======] 100% Fetch remote repository...
    Do you wish to create a custom hardware profile? [no] no
    Error: AVD not created.
    null

    Cannot create any AVDs now.

  • DarrenKayDarrenKay GBUniversity ✭✭

    Cleaned off all SDK off machine
    Installed latest SDK via command line
    Installed single platform, system images and google api
    Created AVD from command line
    Emulator from command line started AVD successfully
    Ran VS 2017 installer to update to latest version

    VS2017 now recognises my new AVD, launches it and inspector can connect. This time I made sure I did not use the Xamarin SDK Manager and it all works as expected.

  • DarrenKayDarrenKay GBUniversity ✭✭

    And after working in VS for a few hours, I now have two SDK versions installed? The version I installed 26 and now 25, so the SDK is broken. The use of the android SDK in VS seems completely broken, I give up.

Sign In or Register to comment.