cordova-plugin-push: Unable to build app for Android SDK 31 or 32.
Bug Report
It is not possible to build the application for android platform sdk 31 and 32 after adding the plugin.
Platform and Version: Android Sdk 31 and 32
cordova info Printout
Task :app:compileDebugKotlin FAILED w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath: C:///.gradle/caches/transforms-3/385d3cef332eae6d8c833ca4a22c5d7f/transformed/jetified-kotlin-stdlib-jdk8-1.3.72.jar (version 1.3) C:///.gradle/caches/transforms-3/37c16254af6de93c45d2587b8dfcd992/transformed/jetified-kotlin-stdlib-jdk7-1.5.20.jar (version 1.5) C:///.gradle/caches/transforms-3/efb587c616850f9dc0cda8853a96db77/transformed/jetified-kotlin-stdlib-1.6.21.jar (version 1.6) C:///.gradle/caches/transforms-3/b6f68fc904e7a7217e6038f3031dcf3a/transformed/jetified-kotlin-stdlib-common-1.6.21.jar (version 1.6) w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath e: C:***\platforms\android\app\src\main\java\com\adobe\phonegap\push\PushPlugin.kt: (466, 57): Unresolved reference: token e: C:***\platforms\android\app\src\main\java\com\adobe\phonegap\push\PushPlugin.kt: (619, 57): Unresolved reference: deleteToken
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 7
- Comments: 27
I think I was able to fix this by adding the following to my config:
My build succeeds at least. No idea why this just started happening. Everything was fine a day or two ago.
@preziotte thanks for your suggestion as above. I’ve applied your suggestion but it does not fix the build yet.
Given, I am using Node - v18.15.0, NPM-v9.5.0, cordova-v11, cordova-android-v11, gulp-v3.9, android-sdk-build-tools-v32.0.0,
Please suggest:
It’s true, cordova is a total mess with every single plugin not being maintained by anyone for 2-4 years and even if people try to maintain them by making PRs, no one accepts them so we end up with 10 forks of the same plugin. I’m only still using this garbage technology because of a large app written using cordova and meteorjs. There is no time to move this to anything newer, it would require a full rewrite to some other framework.
Thank you @preziotte! This kind of things are pushing me to migrate everything to capacitor 😓
Just a bump for “capacitor”. I maintain bunch of hybrid apps. About 50% on capacitor and 50% are still on cordova. The capacitor ones are a dream to maintain with zero issues, whereas every time I make a change on a cordova app, hours are wasted on issues just like this.
https://capacitorjs.com/
Ah I thought i was going crazy! My builds were working fine 2 weeks ago, changed nothing & wasn’t working today 😦. Spent all day looking for a fix until I came across @preziotte’s solution. Fixed it for me! Thank you!
Want to maintain one more? We are looking to outsource the maintenance of our Cordova app.
preziotte - You made my day, after I lost two other days for looking for a solution. BTW it is f…g crazy when one day cordova stops compiling app without any warning.