-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to build app for Android SDK 31 or 32. #218
Comments
Same (or very similar) issue for me. It's very bizarre -- I've been quite happily building my app every few minutes, then bang... build fails. I've not added or removed any plugins, just changed some app JS.
I've not posted the entire error log as it goes on and on, but the key seems to be:
Removing the plugin fixes the issue, but that's not really an option. |
Same here. |
I don't remember exactly what I did to fix this problem, because I had several problems trying to get my app to work for sdk 32. But I believe that reinstalling all my plugins in the most current version and installing jdk 11, one of these two things solved it. Maybe you should start by trying to install JDK 11. |
And of course, make sure you are running the most current version of cordova and cordova-android. |
Thanks, but none of that explains how the app will build without problems, but then fail a few minutes later. I'm already on JDK11. Also, the latest cordova-android is 11.0.0, which is not a trivial update to 10.1.2. |
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 - You made my day, after I lost two other days for looking for a solution. |
@preziotte - worked for us too - thank you very much (our builds stopped working late last Friday after being fine all day) Does anyone know and/or understand exactly what caused this to happen? |
@preziotte thanks. I coud have sworn I'd already tried that, but it does indeed work. Maybe it was after I'd removed annd re-added the plugin and platform a few times. |
Ah I thought i was going crazy! My builds were working fine 2 weeks ago, changed nothing & wasn't working today :(. |
Thank you @preziotte! |
@matscav what's capacitor? |
Me either had the same problem. Trying to fix it, I deleted
|
ref: #224 |
|
Bump up the minSDK to API 23 (Marshmallow, Android 6) - I am not sure why this was API 22; we are certainly not testing on that version Bump the targetSDK to API 32, android 12 (required for Google Play) Switch the push and local notification plugins to ones that support the new trampoline functionality https://developer.android.com/about/versions/12/behavior-changes-12#notification-trampolines The push plugin is a "dev" version but seems to have all android fixes It also bumps up the iOS version so that we can avoid the "non-public selectors" error havesource/cordova-plugin-push#106 e-mission/e-mission-docs#838 (comment) The push plugin had kotlin build errors that were fixed by adding the gradle preferences havesource/cordova-plugin-push#218 (comment) The local notification is a new fork maintained by a new author which requires us to add the new `AndroidLaunchMode` preference. The new plugins already have the compile -> implementation fix So removing the hook added in 6de1f4c Testing done: - builds - generated a local notification by turning off location permissions - clicking on the notification opened the status screen
I had the same error appear on me out of nowhere and I literally spent almost 2 days trying to figure it out. I even switched to MacOS for building thinking it's a Windows issue but it was exactly the same. Everything worked and suddenly stopped. My app builds now after adding the preference, however on MacOS I encountered the problem somewhere else, but thankfully it doesn't cause the build to fail:
Why did it fail in the first place if nothing has changed in the project? Even my cordova gradle config uses Kotlin 1.5.20 and somehow suddenly things stopped working? |
I have already tried the modified version of the plugin, as well as adding the Kotlin version preference to cordova. This whole problem kinda looks like something just started ignoring older Kotlin versions and builds with 1.7.1 anyway. It's weird because during the cordova build I could see that kotlin compiler for 1.5.20 was being downloaded. |
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. |
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. |
I am upgrading an old project from cordova-android@10.x.x to cordova-android@11.x.x. The build did not succeed in my project after this change. however, error regarding JAR Files disappeared. |
@preziotte thanks for your suggestion as above. Given, I am using Please suggest:
|
Thats why we should keep the community alive, and going, so we dont have to spend huge amount of time for rewrite.... Selfishly atleast keep the community going until our retirement lol |
Want to maintain one more? We are looking to outsource the maintenance of our Cordova app. |
@clarklight, that's exactly what the person before you said - people TRY to keep the community alive, but more and more companies are stopping with hybrid apps exactly because they're messy and the Cordova maintainers can't even keep a push plugin alive. This isn't even an official plugin, and unofficial plugins tend to do exactly this: get ghosted and fall out of maintenance. And then, people completely unrelated start showing up with issues and try to jerry-rig solutions (I even have my own fork of this, trying to fix #94 from more than 2 years ago), until someone more knowledgeable tries to steer the ship back to its course. Sadly, it's very rare for a new captain to show up, or the old one to wake up. |
Make sure you do not only upgrade the push plugin to the latest version 4.0.0-dev.0 but either first uninstall the plugin with:
and then reinstall with:
Or manually update the versions under
Finally, you also need to make sure the
Until #238 has been fixed you can use cordova-plugin-android-permissions to check for and request permissions. |
This issue should have been resolved with the latest released version 4.0.0. It has Kotlin version Please reinstall the plugin and try again. |
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
PrintoutThe text was updated successfully, but these errors were encountered: