Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 cordova not building apk

I'm trying to compile a cordova project to apk using Visual Studio 2017, but it gives me this message:

platform android already added

It is not generating an apk. I followed various tutorials but it's no use. I can't get it to work. What to do?

like image 669
Filipe Teixeira Avatar asked Dec 21 '25 10:12

Filipe Teixeira


2 Answers

You have to run it on a android simulator or a android phone for it to build a APK.

For clarification: Yes you have to use a "device" that is actually running android for Visual Studio to actually build the APK, just building the solution won't work.

You can either use your phone, or the microsoft android simulators for this. Running it in the browser doesn't use the APK so VS doesn't build it.

You can find more here http://taco.visualstudio.com/en-us/docs/tutorial-package-publish-readme/#package-the-android-version-of-your-app

like image 70
Sander Avatar answered Dec 24 '25 03:12

Sander


When you install from the Visual Studio Installer, you need to install these options as well. Then only it will build the .apk file

In the right side you can find Android SDK setup, Google Android Emulator under Optional, please enable these options and Install.

pic1

After Installation, when you build, select Debug--->Android---->Google Emulator Phone as shown in image below pic2

like image 29
Faris Razias IT Avatar answered Dec 24 '25 03:12

Faris Razias IT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!