pushbots/phonegap

Android plugin 1.5.0 doesn't compile

Closed this issue · 1 comments

We have a project with:

  • Android studio 3.0
  • minSdkVersion 15
  • targetSdkVersion 23
  • build tools 27
  • cordova 8.0.0
  • cordova android 5.2.0

With the 1.4.9 plugin the project is compiling without problems.

After updating to 1.5.0 the project doesn't compile anymore. Within Android Studio I get a generic gradle error. With "cordova build" I get the following error:

JAVA_HOME=C:\Program Files\java\jdk1.8.0_112
(node:10200) UnhandledPromiseRejectionWarning: CordovaError: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: C:...\AppData\Local\Android\sdk\tools\templates\gradle\wrapper
at Object.module.exports.check_gradle (E:...\platforms\android\cordova\lib\check_reqs.js:90:25)
at GradleBuilder.prepEnv (E:...\platforms\android\cordova\lib\builders\GradleBuilder.js:136:23)
at Api.module.exports.run (E:...\platforms\android\cordova\lib\build.js:152:20)
at E:...\platforms\android\cordova\Api.js:285:43
at _fulfilled (E:...\platforms\android\cordova\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (E:...\platforms\android\cordova\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (E:...\platforms\android\cordova\node_modules\q\q.js:796:13)
at E:...\platforms\android\cordova\node_modules\q\q.js:604:44
at runSingle (E:...\platforms\android\cordova\node_modules\q\q.js:137:13)
at flush (E:...\platforms\android\cordova\node_modules\q\q.js:125:13)
(node:10200) 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:10200) [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.

I seems an error related with SDK versions but in the plugin specs the only requirements are:

cordova: 3.6.3
cordova-android: 5.2.0

What can I do to solve this problem?

Thank you.

Can you please try updating cordova-android to 6.2.0+ or targetSdkVersion to 26?
meanwhile i'm investigating the issue with 5.2.0

You can try

cordova platform remove android
cordova platform add android@7.0.0

then try to build again.