konstantin_doncov
konstantin_doncov

Reputation: 2879

"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?

Upvotes: 18

Views: 11728

Answers (3)

mbi33
mbi33

Reputation: 21

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

Upvotes: 2

MNS
MNS

Reputation: 1394

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.

Upvotes: 15

Adam
Adam

Reputation: 1414

It sounds like you want to forcibly remove Visual Studio and all components. To do this find the original installation medium and use

vs_enterprise.exe /uninstall /force

The vs_enterprise.exe part may be different depending on the type you have installed. For instance, mine is professional.

Check this out for more info: http://blogs.msdn.com/b/heaths/archive/2015/07/17/removing-visual-studio-components-left-behind-after-an-uninstall.aspx

Starting with Visual Studio 2013, you can forcibly remove almost all components. A few core components – like the .NET Framework and VC runtimes – are left behind because of their ubiquity, though you can remove those separately from Programs and Features if you really want. Warning: This will remove all components regardless of whether other products require them. This may cause other products to function incorrectly or not function at all.

also...

Some tips on the problem itself if everything is installed properly:

  • Make sure you have the right project selected for as the Startup Project
  • Check the Minimum Android to Target in Application under the Android project properties

Upvotes: 0

Related Questions