James Wade created CB-9112:
------------------------------
Summary: Can't build Cordova v5.0 Android v4
Key: CB-9112
URL: https://issues.apache.org/jira/browse/CB-9112
Project: Apache Cordova
Issue Type: Bug
Components: Android
Affects Versions: 5.0.1
Environment: Mac OS X Yosemite
node v0.12.2
npm v2.3.0
Android SDK <=v22
Reporter: James Wade
I am trying to get the basic Cordova v5.0 Android v4.0 project to build on Mac
OS X Yosemite, but keep getting this error. I have uninstalled and reinstalled
the Android SDK, Cordova, and even Gradle (but I don't think I need it). I've
checked that my Path variable contains the correct paths to <ANDROID_SDK>/tools
and <ANDROID_SDK>/platform_tools. But when I do the 'cordova build' or
'cordova build android' using java v1.6 (java 1.7 and 1.8 below), I always get
the same error:
> Could not create an instance of type
> org.gradle.invocation.DefaultGradle_Decorated.
Further down it says:
> You may not have the required environment or OS to build this project
What am I missing?
Here's the full text of what I'm doing:
my_acct$cordova create build_test com.example.build_test "BuildTest"
Creating a new cordova project.
my_acct$cd build_test
my_acct$cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms/android
Package: com.example.build_test
Name: BuildTest
Activity: MainActivity
Android target: android-22
Copying template files...
Android project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to
the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
npm http GET https://registry.npmjs.org/cordova-plugin-whitelist
npm http GET https://registry.npmjs.org/cordova-plugin-whitelist
npm http 304 https://registry.npmjs.org/cordova-plugin-whitelist
Installing "cordova-plugin-whitelist" for 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 with an exception.
* What went wrong:
Could not create an instance of type
org.gradle.invocation.DefaultGradle_Decorated.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get 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 for command:
/Users/my_acct/Documents/Development/work/build_test/platforms/android/gradlew
with args:
cdvBuildDebug,-b,/Users/my_acct/Documents/Development/work/build_test/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error:
/Users/my_acct/Documents/Development/work/build_test/platforms/android/cordova/build:
Command failed with exit code 8
You may not have the required environment or OS to build this project
Error:
/Users/my_acct/Documents/Development/work/build_test/platforms/android/cordova/build:
Command failed with exit code 8
at ChildProcess.whenDone
(/Users/my_acct/.node/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
If I change to use java 1.7 or 1.8, the error changes to:
> A problem occurred configuring root project 'android'.
> > Could not resolve all dependencies for configuration ':classpath'.
> > Could 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 the full results for 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 with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could 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 with --stacktrace option to get the stack trace. Run with --info or
--debug option to get 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 for command:
/Users/my_acct/Documents/Development/work/build_test/platforms/android/gradlew
with args:
cdvBuildDebug,-b,/Users/my_acct/Documents/Development/work/build_test/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error:
/Users/my_acct/Documents/Development/work/build_test/platforms/android/cordova/build:
Command failed with exit code 8
You may not have the required environment or OS to build this project
Error:
/Users/my_acct/Documents/Development/work/build_test/platforms/android/cordova/build:
Command failed with exit code 8
at ChildProcess.whenDone
(/Users/my_acct/.node/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]