VS 2015 + Cordova + Emulator for Android = error "unable to deploy"

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?

visual-studio-cordova
asked on Stack Overflow Jan 1, 2016 by DeanB_Develop • edited Jan 2, 2016 by DeanB_Develop

6 Answers

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
answered on Stack Overflow Aug 21, 2016 by Bartho Bernsmann
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

answered on Stack Overflow Oct 27, 2016 by Christian Held
1

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

answered on Stack Overflow Nov 19, 2016 by TigerJabez
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.

answered on Stack Overflow Feb 20, 2017 by Gray
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
answered on Stack Overflow Jan 2, 2016 by DeanB_Develop
0
  • Close VS
  • Open it as Administrator
  • Tools > Visual Studio Emulator for Android
  • Start an emulator
  • Voilá

It worked for me

answered on Stack Overflow Oct 9, 2018 by Tina

User contributions licensed under CC BY-SA 3.0