Open Rac91 opened 2 years ago
up
up
This is not the only Cordova plugin affected. If you create any new app and do a cordova add platform android@latest
the project will not be able to build either a debug or prod APK. Hopefully the developers test their plugins diligently and find a solution.
See if this can help: https://github.com/dpa99c/cordova-plugin-androidx-adapter
@mcrio have already tried this. Didn't help.
I guess you are also using 0.9.0-beta.2
. For me it did the trick somehow :/
Install the following packages:
yarn add cordova-plugin-androidx cordova-plugin-androidx-adapter jetifier -D
Then run:
npx jetifier
I have exactly the same issue...
Install the following packages:
yarn add cordova-plugin-androidx cordova-plugin-androidx-adapter jetifier -D
Then run:
npx jetifier
Thank you! this worked for me. Although I did:
npm i jetifier
Then I installed androidx-adapter: (androidx is built-in in cordova-android versions above 9)
cordova plugin add cordova-plugin-androidx-adapter
and then I ran jetifier
npx jetifier
npx jetifier
Can confirm this worked for me. Although i got this warning:
Plugin doesn't support this project's cordova-android version. cordova-android: 10.1.1, failed version requirement: <9.0.0
Skipping 'cordova-plugin-androidx' for android
I still think that cordova team should be more transparent about these issues.
npx jetifier
Can confirm this worked for me. Although i got this warning:
Plugin doesn't support this project's cordova-android version. cordova-android: 10.1.1, failed version requirement: <9.0.0 Skipping 'cordova-plugin-androidx' for android
I still think that cordova team should be more transparent about these issues.
I checked again and I noticed I have the same error, the thing is, it is fine, androidx is built-in for cordova-android versions above 9. You should be fine with just ignoring that.
Make sure you have this in your config.xml
file:
<preference name="AndroidXEnabled" value="true" />
Hi for me npx jetifier and AndroidXEnabled in config.xml didn't helped.
This is what I get when running jetifier first time:
npx: installed 1 in 5.3s Jetifier is deprecated. Future versions of react-native CLI may not run it by default. Jetifier found 177 file(s) to forward-jetify. Using 4 workers... Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Builder.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Builder.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Builder.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Manager.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Notification.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Notification.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Notification.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Options.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Options.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\util\AssetProvider.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\ClickReceiver.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\action\Action.java
and this is what I get after second run:
npx: installed 1 in 2.836s Jetifier is deprecated. Future versions of react-native CLI may not run it by default. Jetifier found 177 file(s) to forward-jetify. Using 4 workers... Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Builder.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Options.java
Hi for me npx jetifier and AndroidXEnabled in config.xml didn't helped.
This is what I get when running jetifier first time:
npx: installed 1 in 5.3s Jetifier is deprecated. Future versions of react-native CLI may not run it by default. Jetifier found 177 file(s) to forward-jetify. Using 4 workers... Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Builder.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Builder.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Builder.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Manager.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Notification.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Notification.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Notification.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Options.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Options.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\util\AssetProvider.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\ClickReceiver.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\action\Action.java
and this is what I get after second run:
npx: installed 1 in 2.836s Jetifier is deprecated. Future versions of react-native CLI may not run it by default. Jetifier found 177 file(s) to forward-jetify. Using 4 workers... Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Builder.java Jetifier: propose an AndroidX conversion PR to this repository: node_modules\cordova-plugin-local-notification\src\android\notification\Options.java
Yeah that's normal, it should say the "propose an AndroidX conversion PR to this repository" things, those are messages that people should do an androidx conversion, but if I'm not mistaken jetifier fixes it in your files. I have a script setup to reinstall the android platform and run npx jetifier
. If you would like me to, I can send the script here.
I removed android platform and rebuilt everything, now things are working as they should. Not sure what was the issue before, but thank you for your help.
I removed android platform and rebuilt everything, now things are working as they should. Not sure what was the issue before, but thank you for your help.
No problem, glad to have helped!
Hi, I currently have the problem as well. I'm using android 10.1.1 where the androidXAdapter should be installed. But I still can't install without specifically add the androidXAdapter plugin. Does anyone know why?
Yap, that is true, you need to add androidx adapter explicitly.
working for me:
cordova plugin add cordova-plugin-androidx-adapter npm i jetifier npx jetifier
Install the following packages:
yarn add cordova-plugin-androidx cordova-plugin-androidx-adapter jetifier -D
Then run:
npx jetifier
Thank you! this worked for me. Although I did:
npm i jetifier
Then I installed androidx-adapter: (androidx is built-in in cordova-android versions above 9)
cordova plugin add cordova-plugin-androidx-adapter
and then I ran jetifier
npx jetifier
This is a good solution! Working! :)
Thanks
Install the following packages:
yarn add cordova-plugin-androidx cordova-plugin-androidx-adapter jetifier -D
Then run:
npx jetifier
Thank you! this worked for me. Although I did:
npm i jetifier
Then I installed androidx-adapter: (androidx is built-in in cordova-android versions above 9)
cordova plugin add cordova-plugin-androidx-adapter
and then I ran jetifier
npx jetifier
I needed to remove the platform before and re-add again:
ionic cordova platform rm android
ionic cordova platform add android
ionic build
ionic cordova build android
WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
Provide a general summary of the issue. Build fails for android 10.0.0. Tried uninstalling and re-installing the plugin and platform.
Your Environment
Expected Behavior
Build should complete without errors. Tell us what should happen
Actual Behavior
The below error is thrown and the build fails:
Steps to Reproduce
Reproduce this issue; include code to reproduce, if relevant
Context
What were you trying to do? Build the project in cordova
Debug logs
Include iOS / Android logs