Thursday, June 23, 2016

Add a .js to a Cordova project crashes the build process

Leave a Comment

Running Cordova CLI 6.0.0 with Android platform 5.1.1

Creating, adding Android, building and running the sample project works out of the box.

But I now want to add one .js program. If I add it in the obvious place (www / js) or even in www, the build fails with what looks like a spurious error (see below**).

If I load the project into Eclipse (Mars), the build apparently works but running the app fails with ‘res/xml/config.xml is missing’, ‘unable to open asset URL: file///android_asset/www/js/’ and unable to open asset URL: file///android_asset/www/plugins/cordova-plugin-whitelist/whitelist.js’ In other words adding the .js file upsets Eclipse’s ability to find other files nearby in the tree.

DAK please how I simply add a .js file to the default project?

** Execution failed for task ':processDebugResources' com.android.ide.common.process. ProcessException: org.gradle.process.internal.E xecException: Process 'command 'C:\Eclipse\adt-bundle-windows-x86_64-20140702\sd k\build-tools\21.0.1\aapt.exe'' finished with non-zero exit value -1073741819

If I issue a “gradlew.bat --info build clean” command, I get: Script 'C:\ \platforms\android\CordovaLib\cordova.gradle' line: 117 * What went wrong: A problem occurred evaluating root project 'android'. Unable to determine Android SDK directory

1 Answers

Answers 1

Try to set sdk.dir=/Users/userMe/Library/Android/sdk in local.properties file on the root folder of your project.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment