React Native FBSDK版本被IOS和Android搞砸了 [英] React Native FBSDK Version messed up for IOS and Android

查看:149
本文介绍了React Native FBSDK版本被IOS和Android搞砸了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IOS和Android上遇到有关FBSDK软件包版本的问题.

I have an issue regarding FBSDK package version on IOS and Android.

对于Android,如果我使用最新的0.6.0版本,则会出现错误提示:

For Android, if I used the latest 0.6.0 version there is an error saying:

  • 出了什么问题:任务':app:processDebugResources'的执行失败.
  • What went wrong: Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'命令 '/Users/admin/Library/Android/sdk/build-tools/26.0.0/aapt''完成 具有非零退出值1

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/admin/Library/Android/sdk/build-tools/26.0.0/aapt'' finished with non-zero exit value 1

现在要解决这个问题,我必须降级到0.5.0才能正常工作.

Now to sort this out I have to downgrade to 0.5.0 which works fine.

但是在使用0.5.0版本的IOS中,我收到一条错误消息:

However in IOS, using the 0.5.0 version, I get an error saying:

找不到FBSDKCoreKit/FBSDKCoreKit.h

FBSDKCoreKit/FBSDKCoreKit.h not found

所以我必须将其提高到0.6.0才能解决此问题.我不知道如何调整此版本.任何建议都非常感谢,谢谢.

So I Have to bump it up to 0.6.0 to sort this out which is working. I do not know how to align this version out. Any advice is much appreciated thank you.

推荐答案

最后,我克隆了最新的0.6.1版本并修改了代码,使其可以在android和ios上的RN0.43.3上运行.

Finally sorted out, I cloned the latest 0.6.1 version and modify the code so that it can work on RN0.43.3 on both android and ios.

以下是步骤:

  1. 克隆/安装最新版本后,转到您的 node_modules/react-native-fbsdk/js .

打开以下文件:FBLikeView.js,FBLoginButton.js,FBMessageDialog.js,FBSendButton.js,FBShareButton.js.

Open these files: FBLikeView.js, FBLoginButton.js,FBMessageDialog.js, FBSendButton.js, FBShareButton.js.

import PropTypes from 'prop-types';更改为import React, { PropTypes } from 'react';

正在对本机导入更改ViewPropTypesView做出反应.

Under react native import change ViewPropTypes to View.

...ViewPropTypes,更改为...View.propTypes,.

保存更改并完成.

注意:您必须在打开的所有5个文件中执行此操作.

Note: You have to do this in all 5 files you opened.

到目前为止,它完全可以正常工作.

So far it works in my end perfectly.

这解决了有关以下问题:

This solves the issue about:

"LikeView"没有本机类型的propType"RCTFBLikeView.onLayout" 如果您尚未更改,则为布尔值"

'LikeView' has no propType 'RCTFBLikeView.onLayout' of native type 'boolean' if you haven't changed this

这篇关于React Native FBSDK版本被IOS和Android搞砸了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆