PaulProgrammerNoob
PaulProgrammerNoob

Reputation: 654

Apache Cordova: Build failed Error code 1 and Javascript Exception

I am making a little Android-Application with Apache Cordova. Everything was fine until the builds started crashing. As another thread here suggested, I reinstalled the Apache Cordova Plugin I am using (media). At MSDN someone found help by deleting C:/Users/MyName/.gradle and turn off the Firewall, so java will download some stuff again. There I got a failure after the download:

......
    :compileDebugRenderscript UP-TO-DATE
1>  :generateDebugBuildConfig UP-TO-DATE
1>  :generateDebugAssets UP-TO-DATE
1>  :mergeDebugAssets FAILED
1>
1>  FAILURE: Build failed with an exception.
1>
1>  * What went wrong:
1>  Execution failed for task ':mergeDebugAssets'.
1>  > java.lang.NullPointerException (no error message)
1>
1>  * Try:
1>  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>
1>  BUILD FAILED
1>
1>  Total time: 3 mins 11.981 secs
1>  Picked up _JAVA_OPTIONS: -Xmx512M
1>
1>  C:\Users\Paul\Documents\Visual Studio 2015\Projects\LifePointCounter\LifePointCounter\platforms\android\cordova\node_modules\q\q.js:126
1>                      throw e;
1>                            ^
1>  Error code 1 for command: cmd with args: /s /c ""C:\Users\Paul\Documents\Visual Studio 2015\Projects\LifePointCounter\LifePointCounter\platforms\android\gradlew" cdvBuildDebug -b "C:\Users\Paul\Documents\Visual Studio 2015\Projects\LifePointCounter\LifePointCounter\platforms\android\build.gradle" -Dorg.gradle.daemon=true"
1>  Command finished with error code 1: cmd /s /c ""C:\Users\Paul\documents\visual studio 2015\Projects\LifePointCounter\LifePointCounter\platforms\android\cordova\build.bat" --debug "--buildConfig=C:\Users\Paul\documents\visual studio 2015\Projects\LifePointCounter\LifePointCounter\build.json""
1>ERROR building one of the platforms : error : cmd: Command failed with exit code 1
1>  You may not have the required environment or OS to build this project
1>MDAVSCLI : error : cmd: Command failed with exit code 1

The last things I did before this error came up were:

I have no idea what's going on there and I am not very exceperienced with that.

EDIT:

Another Thread suggested Node.js to Version 0.10.36 Now I get exit code 8 and only one error >.<

Upvotes: 1

Views: 2862

Answers (1)

Flavio Sousa
Flavio Sousa

Reputation: 455

For me, the solution was:

cordova clean

then when I run:

cordova emulate android

everything worked again!

Upvotes: 3

Related Questions