Tue, 28 Sep 2021 08:21:09 GMT
Join the conversation at slack.cordova.io
Mon, 27 Sep 2021 12:54:57 GMT
@harel.mazor says
Well, not surprisingly, I added the above “fix” and got compilation errors due to lack of androidX support in some plugins I use. One of them I maintain, so that shouldn‘t be an issue, the other one is out of my hands. Is the androidx-adapter plugin should solve all the androidX issues? do I need to enable androidX now (I understood it’s by default now)? Do I need to enable jetifier? Sorry acting like a noob, but every major upgrade of Cordova version is always hard and frustrating for me :-(
Mon, 27 Sep 2021 12:56:23 GMT
@norman137 says
Try installing
cordova-plugin-androidx-adapter
(i think i got the name correct...)
Mon, 27 Sep 2021 12:56:57 GMT
@norman137 says
It will read your plugin sources and map all the old legacy imports to the equivilant androidx imports
Mon, 27 Sep 2021 13:01:12 GMT
@harel.mazor says
I did, compilation still fails.. 😞
Mon, 27 Sep 2021 13:01:28 GMT
@norman137 says
As of cordova-android@10, androidx is forcefully on. The rationale behind this is because Google kinda made it impossible to support both androidx & legacy support libraries at the same time. We'd basically need to fork the platform if we wanted to support both. This problem also extended to plugin authors.
androidx 1.0.0 of each of its libraries is binary equivalent to android support libs v28. So the quicker people can migrate, the easier the migration would be (just essentially a simple import rename / class renames). Longer we wait, the less that would be the case.
Mon, 27 Sep 2021 13:04:48 GMT
@harel.mazor says
I have no problem with this step. I knew it was coming when I decided to upgrade. I just hoped if I waited long enough most issues will be resolved in the adapter and plugins. This isn‘t the case apparently. I couldn’t find a good guide for upgrading a plugin to use androidX. Are you familiar with such a guide. The following plugin is the one I maintain: https://github.com/HaylLtd/cordova-background-geolocation-plugin/issues/15
Mon, 27 Sep 2021 13:09:19 GMT
@norman137 says
What‘s the error it’s producing?
Mon, 27 Sep 2021 13:14:19 GMT
@harel.mazor says
I'm looking at the plugin code and it seems that it uses a preference variable to determine the com.android.support version, which might cause the adapter to fail. the other plugin that fails is the email composer plugin. The build error is very long, some of it can be seen here:
import android.support.annotation.VisibleForTesting; ^ /Users/harel/IHM/Site/IsraelHiking.Web/platforms/android/app/src/main/java/com/marianhello/bgloc/Config.java:15: error: package android.support.annotation does not exist import android.support.annotation.Nullable;```
Mon, 27 Sep 2021 13:16:01 GMT
@norman137 says
Any imports that starts with
android.support
needs to be refactored to the androidx equivilant package. Strange that thecordova-plugin-androidx-adapter
didn't pick these up
Mon, 27 Sep 2021 13:16:36 GMT
@norman137 says
https://developer.android.com/jetpack/androidx/migrate/artifact-mappings
Mon, 27 Sep 2021 13:16:42 GMT
@norman137 says
https://developer.android.com/jetpack/androidx/migrate/class-mappings
Mon, 27 Sep 2021 13:16:57 GMT
@norman137 says
These 2 links should help
Mon, 27 Sep 2021 13:17:49 GMT
@harel.mazor says
I think the androidx-adapter didn't pick this up due to this line, maybe: https://github.com/HaylLtd/cordova-background-geolocation-plugin/blob/3a7346f849bda98853e40b067222eebed25e565f/plugin.xml#L37
Mon, 27 Sep 2021 13:18:35 GMT
@norman137 says
e.g.,
android.support.annotation.VisibleForTesting
should now beandroidx.annotation.VisibleForTesting
And if you're importing
com.android.support:support-annotations
in gradle, it should now beandroidx.annotation:annotation
Mon, 27 Sep 2021 13:19:53 GMT
@harel.mazor says
The same probably applies to this plugin that also fails in compilation: https://github.com/katzer/cordova-plugin-email-composer/blob/d34201110da0275746c6b39b4512b05909b6331b/plugin.xml#L94 These two plugins fail and seems like they are sharing the same concept related to support libraries...
Mon, 27 Sep 2021 13:19:56 GMT
@norman137 says
yah that line will have to change as well -- androidx I don't think has a single package, that was the point of the androidx change... everything was split into their own micro-package style (like NPM modules...)
Mon, 27 Sep 2021 13:22:46 GMT
@harel.mazor says
Well, I‘m out of time for now. @norman137 thank you very very much for the support you are giving here, it’s not given. I'll see if I can make my plugin support androidX shortly and create a PR or a fork of the email plugin.
Mon, 27 Sep 2021 13:38:28 GMT
@norman137 says
obv the moment you start adding androidx, it means users must be either on
cordova-android@9
withAndroidXEnabled
preference set to true, or oncordova-android@10
Mon, 27 Sep 2021 13:39:08 GMT
@norman137 says
So it might be worth setting the engines accordingly
Mon, 27 Sep 2021 13:51:18 GMT
@harel.mazor says
Yes, but this will be a major version change, users who would like to use the non anroidx version can keep using the old version. I've seen this pattern in one of the plugin I use.
Mon, 27 Sep 2021 15:53:01 GMT
@bemasc says
Hey all, what‘s the status of Cordova-OSX maintenance? It’s been broken on the new M1 Macbooks for most of a year now.
Mon, 27 Sep 2021 15:54:14 GMT
@dpogue says
The hope (but we're not there yet) is to support macOS via cordova-ios with Catalyst
Mon, 27 Sep 2021 15:54:27 GMT
@bemasc says
(Here's a fix PR from over a year ago ... no maintainer comments: https://github.com/apache/cordova-osx/pull/105)
Mon, 27 Sep 2021 15:54:57 GMT
@bemasc says
@dpogue Interesting. Is there a ticket or issue I could follow on that?
Mon, 27 Sep 2021 15:55:27 GMT
@daniellacosse says
https://github.com/apache/cordova-ios/issues/699 is this a good ticket to follow?
Mon, 27 Sep 2021 15:55:36 GMT
@dpogue says
yeah, that one
Mon, 27 Sep 2021 15:57:24 GMT
@bemasc says
Thanks! In the meantime, it would really help if we could get a fixed cordova-osx point release.
Mon, 27 Sep 2021 15:57:29 GMT
@norman137 says
There are plans to deprecate OSX platform
Mon, 27 Sep 2021 15:57:45 GMT
@bemasc says
Good to know
Mon, 27 Sep 2021 15:58:45 GMT
@dpogue says
If we update cordova-osx, do a bunch of plugins also need updates to support M1?
Mon, 27 Sep 2021 16:00:10 GMT
@norman137 says
Think the only reason why it hasn't been formally announced yet (dev docs does mark the platform as deprecated currently), is waiting for a suitable replacement, whether that by via cataylst, or I could see electron platform being a good candidate as well, but it still needs work to have electron implementations for plugins.
Mon, 27 Sep 2021 16:01:17 GMT
@bemasc says
Right now, cordova-osx projects just fail to build with an obscure error message on modern Xcode, so I don't think an update could make it any worse.
Mon, 27 Sep 2021 16:11:14 GMT
@bemasc says
@dpogue We've been building our app using a patched cordova-osx and everything else just worked, so it might be fine.
Mon, 27 Sep 2021 21:50:49 GMT
@harel.mazor says
I fixed the plugin code, removed the other plugin that doesn‘t support AndroidX, upgraded everything. The app crashes due to missing plugin that seems to be ignored for some reason, other plugins fetch shows some warnings. I’m not sure what to do. I‘ve opened a bug here: https://github.com/apache/cordova-android/issues/1360 I’ll be surprised if I‘m the only one experiencing this, but who knows... BTW, any chance to release file-transfer plugin? it was undeprecated a long time ago but it was never updated in npm... I’m still using a git link to a fix there and this causes issues as can be seen in the bug above... this is just a side note...
Tue, 28 Sep 2021 01:17:32 GMT
@norman137 says
i think cordova-plugin-file still remains a blocker for the file transfer release
Mon, 27 Sep 2021 15:43:35 GMT
@norman137 says
Anybody else experience the loss of webview transitions in iOS 15?
Mon, 27 Sep 2021 08:57:28 GMT
@marek.kozela says
hi everyone, can someone help me how to change pipeline process because I have the following error: Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager. We are using the cordova-android 9.1.0. Based on my investigation I found out that this is fixed in cordova-android version 10.0.0, but we cannot upgrade to this version because that change will cause to update all other plugins and dependencies… Is there a workaround for this? Thanks a lot.
Tue, 28 Sep 2021 01:00:59 GMT
@mathewp.94 says
Anyone encountered any issues moving to Android 12? Waiting on a test device to arrive this week but trying to get ahead of things
Tue, 28 Sep 2021 01:18:38 GMT
@norman137 says
It should work as long as you're targeting API 30. Targeting API 31 will not work as it contains several breaking changes, at least in the tooling (requiring AGP 7 / Java 11, etc)
Tue, 28 Sep 2021 03:04:28 GMT
@mathewp.94 says
Good to know, thanks