Cordova 5.1.1 build failing - android

I created a Cordova 5.1.1 project using Visual Studio 2015. I am behind an ntlm proxy. I added the proxy settings anywhere I could find (Gradle, Java console, Crodova CLI, etc.) and use Cntlm for NPM but I still can't get the build to work. Pre-Cordova 5 I had several builds working with Ant.
The build fails with the following error:
FAILURE: Build failed with an exception.
1>
1> * What went wrong:
1> A problem occurred configuring root project 'android'.
1> > Could not resolve all dependencies for configuration ':classpath'.
1> > Could not resolve com.android.tools.build:gradle:1.0.0+.
1> Required by:
1> :android:unspecified
1> > Failed to list versions for com.android.tools.build:gradle.
1> > Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
1> > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
1> > peer not authenticated
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: 2.389 secs
1>
1> platforms\android\cordova\node_modules\q\q.js:126
1> throw e;
1> ^
1> Error code 1 for command: cmd with args: /s /c ""platforms\android\gradlew" cdvBuildDebug -b "platforms\android\build.gradle" -Dorg.gradle.daemon=true"
1> Command finished with error code 1: cmd /s /c ""platforms\android\cordova\build.bat" --debug "--buildConfig=\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
1>
1>Build FAILED.
Note: I have removed the full paths, but they are there in the original build output.
I noticed that the Maven repo certificate is not currently valid, but I have no idea if this is relevant or just some issue with our proxy not passing certificates.

Just do exactly what's suggested here:
http://www.scriptscoop.com/t/82d4495f9d81/android-gradle-cant-connect-to-maven-repo-through-corporate-proxy-need-to-conf.html
Don't forget that you should set a regular http and also https proxy.
This worked for me with exactly the same error you're experiencing.

Related

FAILURE: Build failed with an exception build ionic

I am trying to build a IONIC project but I am facing this exception and I am not able to debug the solution for this.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> failed to find Build Tools revision 24.0.1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
Error: Error code 1 for command: cmd with args: /s,/c,"C:\application\Qrioh\plat
forms\android\gradlew cdvBuildDebug -b C:\application\Qrioh\platforms\android\bu
ild.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
Go to File > Project Structure > Select Module > Properties
Select Build Tools Version same as version selected in Compile Sdk Version.
Hope this will resolve your issue.

Cordova - build release - "Could not resolve all dependencies for configuration ':_debugCompile'?

I had a project using cordova in Visual studio 2015. It runs in ripple and the debug building doesn't have any error. However, it got the following error after I switched to "release build"?
Severity Code Description Project File Line Suppression State
Error FAILURE: Build failed with an exception. stapp 1
Error * What went wrong: stapp 1
Error A problem occurred configuring root project 'android'. stapp 1
Error > Could not resolve all dependencies for configuration ':_debugCompile'. stapp 1
Error > Could not find any version that matches com.android.support:support-v4:+. stapp 1
Error Searched in the following locations: stapp 1
Error https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml stapp 1
Error https://repo1.maven.org/maven2/com/android/support/support-v4/ stapp 1
Error Required by: stapp 1
Error :android:unspecified stapp 1
Error * Try: stapp 1
Error Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. stapp 1
Error Error code 1 for command: cmd with args: /s,/c,"D:\Users\.......\stapp\platforms\android\gradlew cdvBuildRelease -b D:\Users\......\stapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true" stapp 1
1> Wrote out Android package name to "com.greywolfdesign.scenetip"
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-hdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-hdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-ldpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-mdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-xhdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-ldpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-mdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-hdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-ldpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-mdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-xhdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-xhdpi\icon.png
1> copying image from D:\Users\......\stapp\resources\android\icon\drawable-ldpi-icon.png to D:\Users\......\stapp\platforms\android\res\drawable-ldpi\icon.png
1> copying image from D:\Users\......\stapp\resources\android\icon\drawable-mdpi-icon.png to D:\Users\......\stapp\platforms\android\res\drawable-mdpi\icon.png
1> copying image from D:\Users\......\stapp\resources\android\icon\drawable-hdpi-icon.png to D:\Users\......\stapp\platforms\android\res\drawable-hdpi\icon.png
1> copying image from D:\Users\......\stapp\resources\android\icon\drawable-xhdpi-icon.png to D:\Users\......\stapp\platforms\android\res\drawable-xhdpi\icon.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-hdpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-hdpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-ldpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-mdpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-xhdpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-ldpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-mdpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-hdpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-ldpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-mdpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-xhdpi\screen.png
1> Deleted D:\Users\......\stapp\platforms\android\res\drawable-xhdpi\screen.png
1> splash screens: [{"src":"resources/android/splash/drawable-land-hdpi-screen.png","density":"land-hdpi","platform":"android"},{"src":"resources/android/splash/drawable-land-ldpi-screen.png","density":"land-ldpi","platform":"android"},{"src":"resources/android/splash/drawable-land-mdpi-screen.png","density":"land-mdpi","platform":"android"},{"src":"resources/android/splash/drawable-land-xhdpi-screen.png","density":"land-xhdpi","platform":"android"},{"src":"resources/android/splash/drawable-port-hdpi-screen.png","density":"port-hdpi","platform":"android"},{"src":"resources/android/splash/drawable-port-ldpi-screen.png","density":"port-ldpi","platform":"android"},{"src":"resources/android/splash/drawable-port-mdpi-screen.png","density":"port-mdpi","platform":"android"},{"src":"resources/android/splash/drawable-port-xhdpi-screen.png","density":"port-xhdpi","platform":"android"}]
1> copying image from D:\Users\......\stapp\resources\android\splash\drawable-land-hdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-land-hdpi\screen.png
1> copying image from D:\Users\......\stapp\resources\android\splash\drawable-land-ldpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-land-ldpi\screen.png
1> copying image from D:\Users\......\stapp\resources\android\splash\drawable-land-mdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-land-mdpi\screen.png
1> copying image from D:\Users\......\stapp\resources\android\splash\drawable-land-xhdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-land-xhdpi\screen.png
1> copying image from D:\Users\......\stapp\resources\android\splash\drawable-port-hdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-port-hdpi\screen.png
1> copying image from D:\Users\......\stapp\resources\android\splash\drawable-port-ldpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-port-ldpi\screen.png
1> copying image from D:\Users\......\stapp\resources\android\splash\drawable-port-mdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-port-mdpi\screen.png
1> copying image from D:\Users\......\stapp\resources\android\splash\drawable-port-xhdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-port-xhdpi\screen.png
1> updated project successfully
1> Executing "after_prepare" hook for all plugins.
1> Running command: C:\Users\Nick\AppData\Roaming\Microsoft\VisualStudio\MDA\vs-npm\2.14.9\node.exe D:\Users\......\stapp\hooks\after_prepare\010_add_platform_class.js D:\Users\......\stapp
1> add to body class: platform-android
1> Command finished with error code 0: C:\Users\Nick\AppData\Roaming\Microsoft\VisualStudio\MDA\vs-npm\2.14.9\node.exe D:\Users\......\stapp\hooks\after_prepare\010_add_platform_class.js,D:\Users\......\stapp
1> ------ Copied D:\Users\......\stapp\bin\Android\Release\VSBuildInfo.xml to platforms\android\assets\www\VSBuildInfo.xml
1> ------ Building platform: android
1> Release
1> ------ Build configuration options: --release
1> Executing "before_compile" hook for all plugins.
1> ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
1> JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71
1> Reading build config file: D:\Users\......\stapp\build.json
1> Reading the keystore from: d:\downloads\gwdandapp.keystore
1>
1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception.
1> FAILURE: Build failed with an exception.
1>
1>MSBUILD : cordova-build error : * What went wrong:
1> * What went wrong:
1>MSBUILD : cordova-build error : A problem occurred configuring root project 'android'.
1> A problem occurred configuring root project 'android'.
1>MSBUILD : cordova-build error : > Could not resolve all dependencies for configuration ':_debugCompile'.
1> > Could not resolve all dependencies for configuration ':_debugCompile'.
1>MSBUILD : cordova-build error : > Could not find any version that matches com.android.support:support-v4:+.
1> > Could not find any version that matches com.android.support:support-v4:+.
1>MSBUILD : cordova-build error : Searched in the following locations:
1> Searched in the following locations:
1>MSBUILD : cordova-build error : https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
1> https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
1>MSBUILD : cordova-build error : https://repo1.maven.org/maven2/com/android/support/support-v4/
1> https://repo1.maven.org/maven2/com/android/support/support-v4/
1>MSBUILD : cordova-build error : Required by:
1> Required by:
1>MSBUILD : cordova-build error : :android:unspecified
1> :android:unspecified
1>
1>MSBUILD : cordova-build error : * Try:
1> * Try:
1>
1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1> Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1> BUILD FAILED
1>
1> Total time: 1.938 secs
1> ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"D:\Users\......\stapp\platforms\android\gradlew cdvBuildRelease -b D:\Users\......\stapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
1> You may not have the required environment or OS to build this project
1>MSBUILD : cordova-build error : Error code 1 for command: cmd with args: /s,/c,"D:\Users\......\stapp\platforms\android\gradlew cdvBuildRelease -b D:\Users\......\stapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
1> Error code 1 for command: cmd with args: /s,/c,"D:\Users\......\stapp\platforms\android\gradlew cdvBuildRelease -b D:\Users\......\stapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Have you tried to update Android Support Repository and Android Support Library using your Android SDK ? It's often the cause of build failing with that type of line, appearing in your log :
Could not find any version that matches com.android.support:support-v4:+

Cordova Android Build Exception

I am getting this error when trying to build a project created using Cordova CLI. I have added the android platform to the project.
D:\MHIS_Phonegap\MHIS>cordova build --info android
Running command: cmd "/s /c "D:\MHIS_Phonegap\MHIS\platforms\android\cordova\build.bat""
ANDROID_HOME=E:\adt-bundle-windows-x86_64-20130522\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21
Running: D:\MHIS_Phonegap\MHIS\platforms\android\gradlew cdvBuildDebug -b D:\MHIS_Phonegap\MHIS\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
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
> peer not authenticated
* 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: 11.562 secs
D:\MHIS_Phonegap\MHIS\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\MHIS_Phonegap\MHIS\platforms\android\gradlew cdvBuildDebug -b D:\MHIS_Phonegap\MHIS\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\lenovo\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Any help on what is the cause and how to resolve?

How to build phonegap offline from command line

I'm using phonegap 100% from the command line. If I build while connected to the internet it works
$ phonegap build android
[phonegap] executing 'cordova build android'...
[phonegap] completed 'cordova build android'
But if I disconnect from the internet I get errors
$ phonegap build android
[phonegap] executing 'cordova build android'...
cp: no such file or directory: /Users/gregg/src/hft-mobile-app/icon.png
Running command: /Users/gregg/src/hft-mobile-app/platforms/android/cordova/build
ANDROID_HOME=/Users/gregg/Downloads/android-sdk-macosx
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
Running: /Users/gregg/src/hft-mobile-app/platforms/android/gradlew cdvBuildDebug -b /Users/gregg/src/hft-mobile-app/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
>
Failed to list versions for com.android.tools.build:gradle.
>
Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
>
Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
>
repo1.maven.org: nodename nor servname provided, or not known
* 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: 30.753 secs
/Users/gregg/src/hft-mobile-app/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/gregg/src/hft-mobile-app/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/gregg/src/hft-mobile-app/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/gregg/src/hft-mobile-app/platforms/android/cordova/build: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/gregg/src/hft-mobile-app/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Why is the command line version phoning home? How do I get this to build 100% offline?
Note: I see this error as the 2nd line when trying to build offline
cp: no such file or directory: /Users/gregg/src/hft-mobile-app/icon.png
But as you can see that error does not occur online. Plus supposedly whatever that issue was was fixed according to this
I'm on OSX, I've got the Android SDK installed. I had no idea it was calling home. How do I get it to build offline?
This is what I have experienced till now. Ionic uses gradle for android build. It first time downloads all the dependencies from internet. So internet is most for first gradle build but it caches them and no internet is needed for further build.Since you are having problem why don't you globally update your cordova and ionic.
npm install -g cordova ionic

Cordova Android Build Failure

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. Note: The same process builds fine on Cordova v4. 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 /tools and /platform_tools. But when I do the 'cordova build' or 'cordova build android' 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 cordova-android#4.0.0
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)
I figured it out. I found old, conflicting .jar files in ~/Library/Java/Extensions. Blew away the entire ~/Library/Java directory. Cordova (and Android Studio) runs great now.
The other way how this problem can be resolved is by changing the repository from
mavenCentral()
to
maven{
url 'https://repo1.maven.org/maven2'
}
in both platforms/android/build.gradle and platforms/android/CordovaLib/build.gradle

Categories

Resources