0

I am attempting to build an APK in Visual Studio 201 but keep getting this error.

Blockquote 1>Command finished with error code 2: cmd /s /c "C:\Users[my profile]\Desktop\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\build.bat --release --buildConfig=C:\Users[my profile]\Desktop\BlankCordovaApp1\BlankCordovaApp1\build.json" (TaskId:11)

Blockquote 1>MDAVSCLI : error : cmd: Command failed with exit code 2

Blockquote 1>Done executing task "MdaVsCli" -- FAILED. (TaskId:11)

Blockquote 1>Done building target "BuildMDA" in project "BlankCordovaApp1.jsproj" -- FAILED.: (TargetId:11)

I have seen a number of posts on "error code 1" but none on error code 2. As such, I thought this might be helpful. I reinstalled the Android SDK and even reinstalled JDE SE SDK. My thought is that since this references the "build.json" file the it has to do with the signing key but according to the documentation this should still produce and unsigned version of my APK.

Any ideas on this or maybe how to get a deeper log? Thank you!

Community
  • 1
  • 1
Pickel Juavez
  • 23
  • 1
  • 5

1 Answers1

0

I believe this will depend on your build target and your ability to actually build for that target. If you're targetting Ripple you probably won't see this. If you're targetting a proper VM emulator you need to be able to build as if you were building a native application. I was getting a similar error due to the Android SDK not being found, though in my case it was actually telling me it couldn't find the SDK in the output (VS 2015 update 1 - released only a little bit ago so they may have updated their error messages since this question was asked). I had to add the ANDROID_HOME environment variable and add the relevant paths to my PATH variable as well. See this stack overflow answer for that process

Community
  • 1
  • 1
AdamCrawford
  • 4,968
  • 1
  • 18
  • 12