3

I've searched everywhere and there's no info regarding this error. I have android studio, tried several sdk's, same error. The environment variables have also been set up properly.

This is line 40 of build.gradle btw, apply plugin: 'com.android.library'

FAILURE: Build failed with an exception.

  • Where: Build file '/home/user/Documents/app/platforms/android/CordovaLib/build.gradle' line: 40
A problem occurred evaluating project ':CordovaLib'.
org.gradle.api.Project.getPluginManager()Lorg/gradle/api/plugins/PluginManager;

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
        at ChildProcess.whenDone (/home/user/app/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
        at ChildProcess.emit (events.js:182:13)
        at maybeClose (internal/child_process.js:947:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
    (node:2259) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
    (node:2259) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
1
  • 1
    Which cordova and ionic versions are you using exactly? Commented May 14, 2018 at 6:16

1 Answer 1

1

For those of you getting this error, it has to do with your gradle configuration. I've installed gradle through package manager and it installed an old version, which I asumed it was fine. At least v4.1 of gradle is required to work properly with the latest cordova and android.

Make sure you install the newest gradle from their website: https://gradle.org/install/#manually

Set your gradle PATH properly: $ export PATH=$PATH:/gradle_install_loc/gradle-4.7/bin

Also make sure you're running the correct gradle version in your .properties and .gradle files in your project folder:

/app_name/platforms/android/gradle/wrapper/gradle-wrapper.properties

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.