Reputation: 448
When I am trying to use Ionic's social sharing plugin (https://ionicframework.com/docs/native/social-sharing/) I receive the following error message: ERROR: Plugin 'SocialSharing' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
I am testing on an mobile device (Iphone 7 - IOS 12 - and the error shows up in Xcode).
The way I am trying to open the social share is:
this.socialSharing.shareViaFacebook(null, null, link).then(() => {
console.log('I'm in');
}).catch((error) => {
console.log('err', error);
});
In my config.xml I already have:
<plugin name="cordova-plugin-x-socialsharing" spec="5.4.4">
<variable name="ANDROID_SUPPORT_V4_VERSION" value="24.1.1+" />
</plugin>
What could be the cause of this issue ?
Thank you!
Upvotes: 4
Views: 3860
Reputation: 3147
The plugin
cordova-plugin-x-socialsharing
has an issue in the version you are using and the build fails with:
FAILURE: Build failed with an exception.
* Where:
Build file '/home/mj/projects/benara-sales-client/platforms/android/build.gradle' line: 266
* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not get unknown property 'ANDROID_SUPPORT_V4_VERSION' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
To fix, you may install v5.4.0
so remove the plugin and the correct version (you have 5.4.4, try 5.4.0)
cordova plugin rm cordova-plugin-x-social-sharing
cordova plugin add [email protected]
Hope this helps.
Upvotes: 2