Skip to content
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

Change cordova plugin for Social Sharing #5408

Closed
fredriksthlm opened this issue Jan 31, 2022 · 1 comment
Closed

Change cordova plugin for Social Sharing #5408

fredriksthlm opened this issue Jan 31, 2022 · 1 comment
Assignees
Milestone

Comments

@fredriksthlm
Copy link

fredriksthlm commented Jan 31, 2022

Problem description

When we export Cordova applications we use outdated (and deprecated) libraries which should not longer be used. There are new AndroidX-libraries to use instead. This happens when we export with Share-plugin.

Officially Cordova do not longer support the Android Support libraries any longer at all since v10.

The reason for this is that shortercode forked the "original" SocialSharing-plugin (back in Feb 2019!) since the original plugin back then did not work at all with AndroidX. According to Iain his fork should be abandoned when the master was patched.
Which it is, since long time ago.

shortercode/Scirras fork
https://www.npmjs.com/package/cordova-plugin-androidx-socialsharing

The "original"
https://www.npmjs.com/package/cordova-plugin-x-socialsharing

On his github you can clearly see that it now supports AndroidX since a couple of years.
https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/blob/master/README.md

Steps to reproduce

Create new project.

  1. Include the Share plugin.
  2. Export for cordova (or Android Studio)
  3. View config.xml / config.json

Observed result

The plugin used is:
cordova-plugin-androidx-socialsharing

Expected result

The plugin that now should be used:
cordova-plugin-x-socialsharing

More details

Why is this an issue? Since no one is updating Ians fork, no one will fix any upcoming issues. His fork now uses the very old "Android support libraries" (version 24, from 2018!), which is deprecated since long time ago.
android.support:support-v4:24.1.1

Eddys updated plugin uses the "correct" androidx libraries:
androidx.legacy:legacy-support

Edit: Cordova has officially stated that all plugins now should migrate to the AndroidX library and they no longer support the Android Support Library at all.
https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html

You can see additional info on this bug, where shortercode commented it:
EddyVerbruggen/SocialSharing-PhoneGap-Plugin#1034

and also that it is now fixed:
EddyVerbruggen/SocialSharing-PhoneGap-Plugin#1039

With the current fork you get warnings for using old libraries in Android Studio and you can do a migration manually. But this should not be needed for a Construct-export.
Also there has been a lot of bug fixes to the plugin since ians fork, so should really be switched back now.

Affected browsers/platforms:

First affected release:

System details

View details

PASTE HERE

@AshleyScirra AshleyScirra self-assigned this Feb 1, 2022
@AshleyScirra AshleyScirra added this to the Next beta milestone Feb 2, 2022
@AshleyScirra
Copy link
Member

Thanks for the heads up, it does look like things have moved on since the Share plugin was last maintained. I've switched it over to use cordova-plugin-x-socialsharing@6.0.3 on Android for the next beta. (I removed it for iOS, since the Web Share API works in WKWebView and supports files, so there's no need for the Cordova plugin there any more.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants