问题
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:
After cloning/installing the latest version, go to your node_modules/react-native-fbsdk/js.
Open these files: FBLikeView.js, FBLoginButton.js,FBMessageDialog.js, FBSendButton.js, FBShareButton.js.
Change
import PropTypes from 'prop-types';
toimport React, { PropTypes } from 'react';
Under react native import change
ViewPropTypes
toView
.Change
...ViewPropTypes,
to...View.propTypes,
.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