pwlin / cordova-plugin-file-opener2

A File Opener Plugin for Cordova
MIT License
314 stars 587 forks source link

Update FileProvider to use androidX #292

Closed erodrigues-dev closed 3 years ago

erodrigues-dev commented 4 years ago

After update to AndroidX, build is broken, this change refactor to work again

pwlin commented 4 years ago

Hi @erodrigues-dev Thanks for this PR. If I merge this PR, does the plugin still works on older Android (5,6,7,8 etc) devices?

erodrigues-dev commented 4 years ago

It won't, because the class namespace has been changed to androidx, sorry

pwlin commented 4 years ago

Thanks for explanation. We need to find a way to make this backward compatible otherwise a lot of users with older Android devices will not be able to use this plugin anymore.

drewwynne0 commented 4 years ago

@erodrigues-dev I suspect you are looking for cordova-plugin-androidx-adapter - i was running v1.1.0 but since updating to v1.1.1 all is working again

erodrigues-dev commented 4 years ago

@erodrigues-dev I suspect you are looking for cordova-plugin-androidx-adapter - i was running v1.1.0 but since updating to v1.1.1 all is working again

I tested this lib but it didn't work, the only way I found was to fork the project and installed it at npm pointing to my fork

erodrigues-dev commented 4 years ago

Thanks for explanation. We need to find a way to make this backward compatible otherwise a lot of users with older Android devices will not be able to use this plugin anymore.

I understand, I don't know how to help you with this, my project broke after this update and I needed a solution quickly. So I forked the project and corrected the compilation error, and changed the dependency of the project to use my fork.

pwlin commented 4 years ago

It's all right, thanks for your PR anyway. I still have adding Android X support for this plugin in my todo list.

erodrigues-dev commented 4 years ago

It's all right, thanks for your PR anyway. I still have adding Android X support for this plugin in my todo list.

I think the best way is to update the plugin for androidX. Users will continue to use your plugin in old projects, using a previous release. You could make that clear in the project readme.

ucsbricks commented 4 years ago

@erodrigues-dev I am sorry, but I don’t believe your suggested approach is practical. One app binary has to support all Android versions. There is no way to convince a customer they should publish to different apps, one for older devices and another one for newer devices.

erodrigues-dev commented 4 years ago

@erodrigues-dev I am sorry, but I don’t believe your suggested approach is practical. One app binary has to support all Android versions. There is no way to convince a customer they should publish to different apps, one for older devices and another one for newer devices.

This would be the perfect scenario, I hope you can

StefanVanStaden commented 4 years ago

@erodrigues-dev I am going to point the npm package to this fork as well until it is merged. Driving me nuts changing the package name after every build during the development cycle.

erodrigues-dev commented 4 years ago

@erodrigues-dev I am going to point the npm package to this fork as well until it is merged. Driving me nuts changing the package name after every build during the development cycle.

Feel free my friend. Follow the command

npm i cordova-plugin-file-opener2@erodrigues-dev/cordova-plugin-file-opener2
WuglyakBolgoink commented 3 years ago

@erodrigues-dev / @pwlin

any updates??

I think supporting androidX should be finished in a new major version and ppl must upgrade plugin.

"androidx.appcompat:appcompat:X.Y.Z" replace the old v4 support...

erodrigues-dev commented 3 years ago

Hi, use jetifier npm package