3

Using the default Blank Cordova project in VS2015 update 1, I try to publish (Debug > Android > Device) to the Android Emulator (Tools > Visual Studio Emulator for Android) and I get the following error:

enter image description here

Severity    Code    Description Project File    Line    Suppression State
Error       Unable to deploy to Android device, no attached device was found. If you recently attached a device, you may need to wait a few seconds before it is recognized.    BlankCordovaApp2        

I am also getting the following error when I click Yes in the pop-up deployment errors window :

Operation not supported. Unknown error:0x80070057

enter image description here

Here's the device list from ADB confirming the VM is being detected. enter image description here

No luck with the following.

  • I reinstalled Android SDK Manager and updated files.
  • I removed and then re-installed VS2015 community.
  • I can use adb.exe to check for the emulator device and it sees the device.
  • The android emulator appears to be working and displaying properly.
  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK is pointing to the correct location
  • renamed CoreCon
  • Ran Dependency Checker (Tools > Options > Tools for Apache Cordova)
  • I can deploy the .apk package on the Android emulator using adb install folder\location\xxx.apk

Any thoughts?

DeanB_Develop
  • 2,107
  • 3
  • 23
  • 37
  • did attached any mobile using usb ? – Krsna Kishore Jan 02 '16 at 05:08
  • @Webruster There are currently no mobile devices connected to the computer via USB. – DeanB_Develop Jan 02 '16 at 15:06
  • Yes, then you are unable to deploy it, set the sartget to `ripple` rather than the deploy and try to build it – Krsna Kishore Jan 02 '16 at 16:48
  • @webruster, Sorry my question wasn't clear. I can use ripple (`Debug > Android > Ripple - XXXX`), and I can push to a device connected via USB without a problem. In my case, I want to debug using the Visual Studio Emulator for Android (`Tools > Visual Studio Emulator for Android` ). I know I could use GenyMotion or `Debug > Android > Google Android Emulator`, but the integration and debugging is superior with the VS emulator. In addition, I've had great success using Visual Studio Emulator for Android and it is not working. I hope this clarifies my problem. – DeanB_Develop Jan 02 '16 at 16:57
  • @webruster. I'm very familiar with VS2015 + Cordova. You mention `set the sartget to ripple rather than the deploy`. I don't know what sartget is. Could you clarify. Thanks – DeanB_Develop Jan 02 '16 at 16:59
  • refer [this](http://stackoverflow.com/questions/32631284/error-adb-exe-when-running-visual-studio-2015-rc) question, its already been asked to Microsoft team and u can followup with him whether he got any solution , lastly i would say that in `%AppData%\Microsoft\VisualStudio` data might be corrupted – Krsna Kishore Jan 02 '16 at 17:22
  • @webruster Thanks for the link and all the help! I tried the fix, and unfortunately it didn't work. Fortunately, I did find a work around to my problem. I'll post it as an answer. – DeanB_Develop Jan 02 '16 at 18:13

6 Answers6

3

All I had to do was enable Android USB Debug on my phone.

  1. Go to Configuration > System > About the Phone (My Phone is in Portuguese, so the menu options may differ a little bit)
  2. Scroll to the bottom and tap on "Version number" around 10 times
  3. A new option called "Developer" will be available under Configuration > System. Open it
  4. Enable USB Debugging
  5. Deploy the app again
Bartho Bernsmann
  • 2,393
  • 1
  • 25
  • 34
1

Windows 10, VS 2015, Cordova 6.3.1, Using Andriod 23

I hab some trouble with different adb.exe errors and i fixed all of them. Perhaps this checklist will help. (Some things were already mentioned but nevertheless^^ her is my list):

  1. Make sure yor device is connected to your Laptop. Check this with the console command "adb devices" (you have to be in the directory where adb.exe is)

If you see more than one an emulator is running , kill him (restart pc) if you see nothing check out another usb cable.

  1. DELETE the app from your phone e.g. if you changed developing machine.

  2. When installing MS Visual Studio you can first uncheck all and then only check Javascript->Cordova. Setup will make the rest. But install node.js and andriod-sdk (only sdk not the wohle andriod development studio... no need)

  3. with the Andriod SDK-Manager make sure you have "Andriod sdk build tools" ONLY for your version installed.... for me 23.. AND Extras->"Andriod Suppot Repository" i have it like this:

here you can see my SDK Manager Part 1

here you can see my SDK Manager Part 2

5.Make sure you have developer options activated on phone and USB-Debugging is enabled. And on startup make sure you allow access from the Machine e.g. laptop to your device e.g. phone. A prompt should appear on your device.

cya

1

I encountered a similar problem. Solution: 1)Open Developer tools in android devices and Revoke USB debugging authorizations 2)Then restart USB debugging

TigerJabez
  • 11
  • 1
1

I was able to resolve this by editing the config.xml file and changing the Target API Level to match the installed version of the Android OS on my phone for development. Here is a link to the google developer docs:

https://developer.android.com/about/versions/marshmallow/android-6.0.html

It contains info on backward compatibility to help with setting the version appropriately.

Gray
  • 27
  • 7
0

Here's a work around to my problem. It doesn't fix the original problem, but it does allow me to debug using the Visual Studio Emulator for Android

Work Around:

Use the Debug > Android > VS Emulator XXX in the drop down to open the emulator and debug. VS Emulators can be added by using Tools > Visual Studio Emulator for Android

enter image description here

Previous Workflow:

  1. Open Tools > Visual Studio Emulator for Android
  2. Launch the Device Profile
  3. Wait for the Device Emulator to open
  4. Debug the project by using Debug > Android > Device
DeanB_Develop
  • 2,107
  • 3
  • 23
  • 37
0
  • Close VS
  • Open it as Administrator
  • Tools > Visual Studio Emulator for Android
  • Start an emulator
  • Voilá

It worked for me

Tina
  • 1