This issue does not exist on Visual Studio 2015, which allows using your own ANDROID_HOME setting while deploying to devices and emulators correctly. You can still use Chrome’s Remote Debugging with the device inspector, but this won’t debug non-Javascript plugins. However, you won’t be able to use the Visual Studio built-in debugging tools.
If you persist in changing the ANDROID_HOME setting, you can still manually deploy to emulator using the cordova emulate command: cordova run -emulator
How to use my own ANDROID_HOME and deploy to emulator then? It seems VS2017 can only deploy to emulatos when using the Android SDK API 25 provided by the Tools for Apache Cordova from the VS2017 installer.
Unfortunately, setting your custom ANDROID_HOME to use a newer API will destroy the Deploy to Google Android Emulator option and replace it will Install Google Android Emulators. You can get and manage your installed Android SDK using the classic Android SDK Manager:Ĭhanging the Visual Studio 2017 Android SDK path here removes the Deploy to Emulator option. Cordova 7.1.0 requires the Android SDK 26 to compile, so you must set the ANDROID_HOME setting from Visual Studio to your externally installed Android SDK. When you managed to change the Cordova CLI and cordova-android version, you may encounter an error related to the Android SDK (API 25). Build fails because newer Android SDK is required More details on this issue in this answer on Stackoverflow.
Save config.xml and reload the project, your globally installed version will be used from now on, and the update warning message will be gone. Warning 2: If there’s no vs:toolsetVersion tag present in your config.xml, you’ll need to add the vs namespace attribute to the widget element in config.xml, as follows: xmlns:vs="" Warning 1: Regardless of the version number inserted here, your globally installed Cordova version will be actually used for all build operations, as long as it’s greater than 6.3.1. In order to change the Cordova version in your project, manually edit config.xml in View Code mode to locate this: 6.3.1Īnd replace it with your globally installed version number (9.0.0 in this case). This is because whenever you change the toolset, the config.xml is not properly updated. Your Cordova project needs to be updated to work with Visual Studio 15. If you change it to use the Globally Installed Cordova version, this setting is forgotten next time you open the project and you are invited to convert the project: The selected Cordova toolset is not savedīy default, Visual Studio 2017 will create new Apache Cordova projects with its own Cordova 6.3.1 toolset.
Note that compiling for Windows 10 / Windows Mobile 10 will still work with latest Cordova versions, such as Cordova 9.0.0/10.0.0 and the platform. This introduces the problem that your Android emulators are no longer detected and you cannot deploy to emulator (see detailed issue below this page).
However, you can try the solution to Error DEP10402 to change the APK output path and avoid this error. This is because in cordova-android 6.4.0 the APK output path has been changed, causing Visual Studio to no longer find the APK and assume the build has failed. When using cordova-android 6.4.0 or newer, your apps won’t be deployed to device nor emulator.Nothing serious though, deploy to device, emulators and debug actually work fine.
But this version is too old for certain plugins, like the phonegap-plugin-push.