-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
androidx #565
Comments
The short answer is no, at least for now. The existing support library will continue to exist for the foreseeable future, so cordova-android should be fine. However, we should probably look into migrating to AndroidX with a major version bump. We can't do it sooner, because AndroidX is only available when targeting Android 9 and higher. Also worth noting that there's an AndroidX WebView compatibility library, but we can't use it until we drop support for Android 4.4 (which is not happening in the next major) |
I did take a look, started composing an answer while working on something else. My impression from https://android-developers.googleblog.com/2018/05/hello-world-androidx.html is that (My trick was to search all Java files in cordova-android for "import com.android", "import android.arch", "import android.databi", and "import android.supp", according to affected namespaces described in https://developer.android.com/jetpack/androidx/migrate) |
Some plugins (i.e., camera) have to use the support library for dealing with FileProviders |
Would this be more plugin-specific then? I wonder if we could support AndroidX vs old style in a separate plugin for a while? |
Hi there 👋I'd like to better understand the current schedule for the AndroidX migration of We (the team at PSPDFKit, and maintainers of PSPDFKit/Cordova-Android) have previously upgraded our Android library to AndroidX (as many of our customers did with their apps and libraries too). We're currently getting reports of Cordova users that fail to upgrade due to the lack of AndroidX support in There's a couple of factors that should be considered for your schedule for migrating to AndroidX:
Are there any concrete plans for migration to AndroidX so far, and if so, could you share them with us? Any feedback would be highly appreciated. |
@davidschreiber it would really help if you could explain what exactly is going wrong. I tried to explain in #565 (comment) that none of the code in this project ( I took a quick look through README.md in https://github.com/PSPDFKit/Cordova-Android and noticed that it needs the nightly release of cordova-android@8. You can see in apache/cordova#10 that we are in the process of finishing and releasing the Cordova 9 major release so that your users will no longer need the nightly release. |
Hi @brodybits. Thanks for the feedback. You're absolutely right that this is not a specific issue to the code inside
The specific issue our customers are facing is a D8 build time error which comes from including Cordova plugins that still use the support libraries (in this specific case the
Thank you very much for the heads-up. It's great to hear that the update to Cordova 9 is progressing well, and we're looking forward to the stable release of it. I'm sorry if I misunderstood the scope of Cordova 9. Do I now understand it correctly, that major releases of |
Yes + Yes please! |
I would be grateful if someone could post a demo project. I already spent almost half a day without success using AndroidX from a Cordova-Android project. |
I created a small sample project by following these steps: cordova create cordova-example2 com.pspdfkit.cordovaexample cordova-example
# Brings in AndroidX
cordova plugin add https://github.com/PSPDFKit/Cordova-Android/
# Brings in the Support Library
cordova plugin add cordova-plugin-camera
# Required for building PSPDFKit
cordova platform add android@8.0.0-nightly.2018.11.23.ef243418 In order to build the project, you need to bump compile target to Add this to
Change content of
You can now run the build, which will fail due to a conflict between AndroidX and the Support Library: cordova build android -- --gradleArg=--stacktrace In order to check that migrating the plugin to AndroidX works, I've created a small PR that actually migrates the plugin: apache/cordova-plugin-camera#418. By swapping out the plugin with my PR version, you can verify that the migration works:
|
Thanks @davidschreiber. I was able to reproduce a successful build with AndroidX using
A few minor points so far:
Here is how I reproduced the build failure with AndroidX and the old Support Library:
I got the following build failure output:
Here is how I reproduced a working AndroidX build with
As a next step I hope we can find an easier way to reproduce the failure with AndroidX due to the conflict with plugins using the old support library. I hope to work on it soon, cannot make any promises right now. I hope we can get this resolved in the Apache Cordova plugins before we finish the Cordova 9 release (apache/cordova#10). |
@davidschreiber I really appreciate your efforts to help resolve this issue, especially in apache/cordova-plugin-camera#418. I am very sorry that it has not proven to be so easy to resolve the issue with AndroidX in Cordova. I think you pointed out a very important issue with the compile SDK version (#631), which should be resolved before we continue with AndroidX support. I cannot promise when I will get a chance to resolve #631 due to some other priorities and commitments. |
Hi! Just checking on the status of AndroidX and the Cordova ecosystem. |
New Cordova 9 release has been shipped. As discussed before, the only possible issue with AndroidX is in the plugins. I think it would be good to get this resolved before we ship the major release of the plugins. The one plugin where I could see this issue is I personally do not have so much time to work on this issue due to some other priorities. |
@davidschreiber @steipete did you guys see From apache/cordova#69 (comment) it sounds like I wonder if we should integrate the changes from |
I think I agree with the idea that the next major version of Android should be set up to use AndroidX in gradle, and all plugins using Android Support Libraries should be migrated to AndroidX. |
@dpogue Until such time as plugin authors have updated their plugins to migrate to AndroidX, it should be possible to use cordova-plugin-androidx-adapter to migrate their legacy plugin code in-place inside a Cordova Android project. |
I’ve installed it today for our app and so far it works great 👍
…Sent from my iPhone
On 24. Apr 2019, at 7:35 PM, Dave Alden ***@***.***> wrote:
@dpogue Until such time as plugin authors have updated their plugins to migrate to AndroidX, it should be possible to use cordova-plugin-androidx-adapter to migrate their legacy plugin code in-place inside a Cordova Android project.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thank you! You are a lifesaver! I was going to start editing each plugin by hand and I found your message :) :) |
Hi all, It seems a lot of plugins still have issues despite the androidx plug in that @dpa99c has created. The problem is these plugins are used for critical functions of our app and we can't get Android Studio to compile or even within the command line. I have opened bug reports in each of the different repositories for this but besides that we have found no solution and we can't publish any new app updates anymore and don't know what to do: apache/cordova-plugin-camera#539 There is also some weird issue where after adding android to the cordova platforms every time we open with Android Studio there is an issue with the gradle file having some weird 27.+ line that gradle doesn't like. We also have no idea why cordova does this and haven't found any info anywhere. If @Be4t5 , @timbru31 @brodybits have any suggestions on how to fix this it would be highly appreciated. Oh and as a side note in case this is useful information: we did not have these issues before moving to Cordova Android 8.x versions. Everything was compiling correctly. |
That's why I re-created another plugin, which is written in The purpose of this plugin is little different from However plugin developers have to support both environments for a while ( That's why this plugin migrates from And this plugin uses
|
Just learned about
androidx
, this new package name Google uses or will use for support libraries and similar stuff:https://stackoverflow.com/questions/51280090/what-is-androidx
https://developer.android.com/jetpack/androidx/
Will this affect cordova-android?
The text was updated successfully, but these errors were encountered: