当我尝试使用Ionic的社交共享插件(https://ionicframework.com/docs/native/social-sharing/)时,我收到以下错误消息: ERROR: plugin 'SocialSharing‘not found,or is not a CDVPlugin。在config.xml中检查您的插件映射。
我在一个移动设备上测试(iPhone7-iOS12-错误显示在Xcode中)。
我尝试打开社交共享的方式是:
this.socialSharing.shareViaFacebook(null, null, link).then(() => {
console.log('I'm in');
}).catch((error) => {
console.log('err', error);
});在我的config.xml中,我已经有了:
<plugin name="cordova-plugin-x-socialsharing" spec="5.4.4">
<variable name="ANDROID_SUPPORT_V4_VERSION" value="24.1.1+" />
</plugin>此问题的原因可能是什么?
谢谢!
发布于 2019-07-02 23:29:03
插件
cordova-plugin-x-socialsharing 在您正在使用的版本中有一个问题,并且构建失败,出现以下错误:
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.要进行修复,您可以安装v5.4.0
所以删除插件和正确的版本(你有5.4.4,试试5.4.0)
cordova plugin rm cordova-plugin-x-social-sharing
cordova plugin add cordova-plugin-x-social-sharing@5.4.0希望这能有所帮助。
https://stackoverflow.com/questions/54272544
复制相似问题