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.
The updated version of the VS Installer switched to use the new Xamarin SDK AVD managers. SO a clean install of VS2017 and the managers solved my issue. The Google CLI managers just don't want to play ball with VS
Answers
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?
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
If you quit the emulator and let VS start it when you begin debugging, does the error go away?
VS does not show any google emulator AVDs in the drop down, I have to launch them from the AVD manager or cmd line
@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.
@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 theavdmanager
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 usingavdmanager
CLI or Android Studio?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
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.
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.
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'.
`
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.
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.
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.
Hi. I also cannot make the command line avdmanager create a new AVD. Not sure if this is totally related to OP's problem, but I'm getting this:
`> avdmanager create avd --device 10 --name Nexus6_api25 --abi google_apis/x86 --package 'system-images;android-25;google_apis;x86'
Error: Package path is not valid. Valid system image paths are:ository...
system-images;android-25;google_apis;x86
system-images;android-21;google_apis;x86_64
system-images;android-24;google_apis;x86_64
system-images;android-24;google_apis;armeabi-v7a
null`
As you can see I'm specifying a package which is listed in the valid packages list. The error message is copied verbatim, truncated words and all.. I'm also about to give up.
I don't understand the need to deprecate a tool that was working and give people a broken replacement instead. Mobile development is not looking like a place I want to be in these days..
The updated version of the VS Installer switched to use the new Xamarin SDK AVD managers. SO a clean install of VS2017 and the managers solved my issue. The Google CLI managers just don't want to play ball with VS