React Native FBSDK Version messed up for IOS and Android

故事扮演 提交于 2019-12-11 17:37:30

问题


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

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

  • What went wrong: Execution failed for task ':app:processDebugResources'.

    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

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

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

FBSDKCoreKit/FBSDKCoreKit.h not found

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.


回答1:


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.

Here are the steps:

  1. After cloning/installing the latest version, go to your node_modules/react-native-fbsdk/js.

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

  3. Change import PropTypes from 'prop-types'; to import React, { PropTypes } from 'react';

  4. Under react native import change ViewPropTypes to View.

  5. Change ...ViewPropTypes, to ...View.propTypes,.

  6. Save the changes and done.

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' has no propType 'RCTFBLikeView.onLayout' of native type 'boolean' if you haven't changed this



来源:https://stackoverflow.com/questions/45726615/react-native-fbsdk-version-messed-up-for-ios-and-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!