Cordova Android Build Failure -


i trying basic cordova v5.0 android v4.0 project build on mac os x yosemite, keep getting error. note: same process builds fine on cordova v4. have uninstalled , reinstalled android sdk, cordova, , gradle (but don't think need it). i've checked path variable contains correct paths /tools , /platform_tools. when 'cordova build' or 'cordova build android' same error:

could not create instance of type org.gradle.invocation.defaultgradle_decorated.

further down says:

you may not have required environment or os build project

what missing?

here's full text of i'm doing:

my_acct$cordova create build_test com.example.build_test "buildtest" creating new cordova project. my_acct$cd build_test my_acct$cordova platform add android adding android project... creating cordova project android platform:     path: platforms/android     package: com.example.build_test     name: buildtest     activity: mainactivity     android target: android-22 copying template files... android project created cordova-android@4.0.0 discovered plugin "cordova-plugin-whitelist" in config.xml. installing project fetching plugin "cordova-plugin-whitelist@1" via npm npm http https://registry.npmjs.org/cordova-plugin-whitelist npm http https://registry.npmjs.org/cordova-plugin-whitelist npm http 304 https://registry.npmjs.org/cordova-plugin-whitelist installing "cordova-plugin-whitelist" android my_acct$cordova build running command: /users/my_acct/documents/development/work/build_test/platforms/android/cordova/build  android_home=/users/my_acct/documents/development/android-sdk-macosx/sdk java_home=/system/library/java/javavirtualmachines/1.6.0.jdk/contents/home running: /users/my_acct/documents/development/work/build_test/platforms/android/gradlew cdvbuilddebug -b /users/my_acct/documents/development/work/build_test/platforms/android/build.gradle -dorg.gradle.daemon=true  failure: build failed exception.  * went wrong: not create instance of type org.gradle.invocation.defaultgradle_decorated.  * try: run --stacktrace option stack trace. run --info or --debug option more log output.  /users/my_acct/documents/development/work/build_test/platforms/android/cordova/node_modules/q/q.js:126                     throw e;                           ^ error code 1 command: /users/my_acct/documents/development/work/build_test/platforms/android/gradlew args: cdvbuilddebug,-b,/users/my_acct/documents/development/work/build_test/platforms/android/build.gradle,-dorg.gradle.daemon=true error building 1 of platforms: error: /users/my_acct/documents/development/work/build_test/platforms/android/cordova/build: command failed exit code 8 may not have required environment or os build project error: /users/my_acct/documents/development/work/build_test/platforms/android/cordova/build: command failed exit code 8     @ childprocess.whendone (/users/my_acct/.node/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)     @ childprocess.emit (events.js:98:17)     @ maybeclose (child_process.js:766:16)     @ process.childprocess._handle.onexit (child_process.js:833:5) 

if change use java 1.7 or 1.8, error changes to:

a problem occurred configuring root project 'android'.

could not resolve dependencies configuration ':classpath'. not resolve com.android.tools.build:gradle:1.0.0+. required by: :android:unspecified org.slf4j.spi.locationawarelogger.log(lorg/slf4j/marker;ljava/lang/string;iljava/lang/string;[ljava/lang/object;ljava/lang/throwable;)v

here's full results using java 1.7 or 1.8:

my_acct$cordova build running command: /users/my_acct/documents/development/work/build_test/platforms/android/cordova/build  android_home=/users/my_acct/documents/development/android-sdk-macosx/sdk java_home=/library/java/javavirtualmachines/jdk1.7.0_79.jdk/contents/home running: /users/my_acct/documents/development/work/build_test/platforms/android/gradlew cdvbuilddebug -b /users/my_acct/documents/development/work/build_test/platforms/android/build.gradle -dorg.gradle.daemon=true  failure: build failed exception.  * went wrong: problem occurred configuring root project 'android'. > not resolve dependencies configuration ':classpath'.    > not resolve com.android.tools.build:gradle:1.0.0+.      required by:          :android:unspecified       > org.slf4j.spi.locationawarelogger.log(lorg/slf4j/marker;ljava/lang/string;iljava/lang/string;[ljava/lang/object;ljava/lang/throwable;)v  * try: run --stacktrace option stack trace. run --info or --debug option more log output.  build failed  total time: 4.859 secs  /users/my_acct/documents/development/work/build_test/platforms/android/cordova/node_modules/q/q.js:126                     throw e;                           ^ error code 1 command: /users/my_acct/documents/development/work/build_test/platforms/android/gradlew args: cdvbuilddebug,-b,/users/my_acct/documents/development/work/build_test/platforms/android/build.gradle,-dorg.gradle.daemon=true error building 1 of platforms: error: /users/my_acct/documents/development/work/build_test/platforms/android/cordova/build: command failed exit code 8 may not have required environment or os build project error: /users/my_acct/documents/development/work/build_test/platforms/android/cordova/build: command failed exit code 8     @ childprocess.whendone (/users/my_acct/.node/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)     @ childprocess.emit (events.js:98:17)     @ maybeclose (child_process.js:766:16)     @ process.childprocess._handle.onexit (child_process.js:833:5) 

i figured out. found old, conflicting .jar files in ~/library/java/extensions. blew away entire ~/library/java directory. cordova (and android studio) runs great now.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -