Search code examples
cordovavisual-studio-2015

Visual Studio won't detect my device


Yes, yet again another question about connecting a device to Visual Studio... I know there are plenty of answers, but I couldn't make it work, hence this new topic.


So I got a Visual Studio Community 2015. I created a new Cordova Project, using Cordova 6.1.1 When I used the ripple emulator, everything works fine. (I got a error 404 about favicon.ico and ripple.js, but the application runs fine)

To test on Android device, I got a Galaxy Note 2 running on Android 4.4.2. Developper option is activated, as weel as "enable USB degugging". Moreover, I can access the phone using windows explorer just fine.

Problem is, when I set "Debug" mode and "Android" Platform, VS2015 doesn't list the device in the menu, I simply got "Device". And if I try to run it nevertheless, I got a popup saying "deployment error, continue anyway ?". If I click on "continue", I got an error popping : "Failed to install apk to device: [ 9%] /data/local/tmp/android-debug.apk"

Do you guys have any idea how to resolve this ?

By the way, in the sdk manager, I installed Android SDK Tools 25.2.2, Android SDK Platform-tools 24.0.3, Android SDK Build-tools 24.0.3, Android 6.0 API and Google USB Driver.

When trying to update the Note 2 driver on my computer, windows says it's already up to date. I even trined to uninstall/reinstall the Google USB Driver.


Solution

  • I finally managed to debug it, and without pdaNet :

    • First, I reinstalled VS2015, and made sure to check "Android NDK", which I don't think I checked the first time
    • I made sure jdk AND jre are correctly installed, and with the same version (I had jre 1.7 and jdk 1.8)
    • I made sure my phone's driver was up to date

    Cleaning and generating the solution was then good, everything runs well !