Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No devices available" in Visual Studio 2015

I trying to deploy Native activity application(Android, C++) on the Visual Studio 2015 embedded emulator. But have a problem: start debugging button has label "no devices available":enter image description here

But my AVD manager has some devices.

Deploy output:

Deploy started: Project: Android3.Packaging, Configuration: Debug x86 ------

Error installing the package. The package 'C:\Users\User\Documents\Visual Studio 2015\Projects\Project\Android3\x86\Debug\Android3.apk' does not exist on disk.

Invalid package information.

I already had the same problem and tried to reinstall Visual Studio several times but it's gives nothing. Besides this in the last time I had to clean the registry manually due to Visual Studio 2015 installer said that I already had android-sdk on the my computer but this was not so.

How can I fix it? How can I completely uninstall Visual Studio and install it right?

OS: Windows 7

UPD:

If I set "Android3.NativeActivity" as startup project, then I get error window:

Unable to start debugging. Check your debugger settings by opening project properties and navigation to 'Configuration properties --> Debugging'

If I set "Android3.Packaging" as startup project, then I get:

Error installing the package. The device '' is invalid or not running. Please switch to another device, or use the Android Virtual Device (AVD) Manager to start a compatible emulator, or connect a compatible Android device.

The device is invalid or is not running.

in the deploy output.

My AVD manager looks like: enter image description here

AVD manager has emulators for API level 19.

Android3.NativeActivity->Properties->General->Target API Level = KitKat 4.4 - 4.4.4, (android-19)

Android3.Packaging->Properties->General->Target API Level = KitKat 4.4 - 4.4.4, (android-19)

So everything set as API level 19.

What else could be wrong?

like image 477
konstantin_doncov Avatar asked Jan 09 '16 15:01

konstantin_doncov


2 Answers

Try following options to get any of the devices listed in Visual Studio.

1. Ensure AVD Instance is Running

Since Visual Studio lists only running instances of Android devices as connectible devices, one need to ensure that any of the Android emulator instance is running. For that, select any AVD from the AVD manager and then push "Start" button. A "Launch Options" dialogue will be displayed. Now push "Launch" button. You can see Android instance running.

2. Ensure AVD instance is Detectable to ADB

Try the command adb devices -l and see that at least one device is listed there.

If an emulator device exists then try connecting to it using the command connect 127.0.0.1:5554 where 127.0.0.1 is the IP address of android instance and 5554 is the (default) port number.

3. Ensure Correct Configuration is Selected

It seems that you will have to select the "ARM" configuration with respect to the CPU architecture shown in your AVD Manager.

In your screenshot, "x86" is the selected configuration and "No devices available" is shown. This is because the AVD manager doesn't have any x86 AVD created in it.

When you select "ARM" configuration (and one of the AVD is up and running) then you should be able to see some devices such as shown below.

enter image description here

As a final step, try closing and then restarting the Visual Studio instance keeping emulated Android instance up and running.

like image 115
MNS Avatar answered Nov 03 '22 14:11

MNS


Try this:

  1. set appriopriate solution platform (eq ARM)
  2. run Android VDM: from list "No device available" select "Android Virtual Device Manager"
    • select appriopriate device (ARM). Click Start
    • Click Start and Launch.
  3. Attach to emulator process [Ctrl+Alt+P] enter image description here
    • select emulator-arm.exe
      (select and attach program from list)
    • and click Attach
  4. You can see new Toolbar Debug Location with Process
    enter image description here
like image 2
mbi33 Avatar answered Nov 03 '22 12:11

mbi33