Closed zhigang1992 closed 4 years ago
facing the same issue when trying to compile v1.0.4 with RN 0.61.4
same trouble after reinstall modules and pods.
Installing FBSDKCoreKit 5.10.0 (was 5.8.0 and source changed to `https://cdn.cocoapods.org/` from `trunk`)
Installing FBSDKLoginKit 5.10.0 (was 5.8.0 and source changed to `https://cdn.cocoapods.org/` from `trunk`)
Installing FBSDKShareKit 5.9.0 (was 5.8.0 and source changed to `https://cdn.cocoapods.org/` from `trunk`)
Installing react-native-fbsdk 1.1.0 (was 1.0.4)
Found temporary solution: replaced all
#ifdef BUCK
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#else
@import FBSDKCoreKit;
#endif
with
#import <FBSDKCoreKit/FBSDKCoreKit.h>
Found temporary solution: replaced all
#ifdef BUCK #import <FBSDKCoreKit/FBSDKCoreKit.h> #else @import FBSDKCoreKit; #endif
with
#import <FBSDKCoreKit/FBSDKCoreKit.h>
May I ask where?
Found temporary solution: replaced all
#ifdef BUCK #import <FBSDKCoreKit/FBSDKCoreKit.h> #else @import FBSDKCoreKit; #endif
with
#import <FBSDKCoreKit/FBSDKCoreKit.h>
May I ask where?
everywhere in fbsdk, i did it in about 23 files
Okay I found another solution. Gonna use it until Facebook fixes their lib:
Change the version prefix from ~>
to =
:
require 'json'
package = JSON.parse(File.read(File.join(__dir__, './', 'package.json')))
Pod::Spec.new do |s|
s.name = package['name']
s.version = package['version']
s.summary = package['description']
s.requires_arc = true
s.author = { 'dzhuowen' => 'dzhuowen@fb.com' }
s.license = package['license']
s.homepage = package['homepage']
s.source = { :git => 'https://github.com/facebook/react-native-fbsdk.git', :tag => "v#{package['version']}" }
s.platform = :ios, '8.0'
s.dependency 'React'
s.subspec 'Core' do |ss|
# ss.dependency 'FBSDKCoreKit', '~> 5.8'
ss.dependency 'FBSDKCoreKit', '= 5.8'
ss.source_files = 'ios/RCTFBSDK/core/*.{h,m}'
end
s.subspec 'Login' do |ss|
# ss.dependency 'FBSDKLoginKit', '~> 5.8'
ss.dependency 'FBSDKLoginKit', '= 5.8'
ss.source_files = 'ios/RCTFBSDK/login/*.{h,m}'
end
s.subspec 'Share' do |ss|
# ss.dependency 'FBSDKShareKit', '~> 5.8'
ss.dependency 'FBSDKShareKit', '= 5.8'
ss.source_files = 'ios/RCTFBSDK/share/*.{h,m}'
end
end
+1
+1
Fixed in 1.1.1
Would be nice if we can figure out how to get it building with the latest sdk
please update unity SDK too
I saw the outdated pod in my dependency report this morning, so I came here, saw this, and just scanned through the related stuff.
Based on fix/release timing it seems like 5.11.1 of the underlying SDK should still have the problem, but it has been identified https://github.com/facebook/facebook-ios-sdk/issues/1105#issuecomment-555740990 and a fix has merged already https://github.com/facebook/facebook-ios-sdk/pull/1133
@janicduplessis The upstream fix merge happened after the last upstream release, so I think the action here is to wait for an upstream SDK release >= 5.11.2 at which point the podspec here can go back from '=' to '~>'. Based on previous release cadence upstream I'd be that's within the next 2 days give or take
Cheers
@mikehardy I am facing this, Is this due to some outdated pod dependency?
I don't know, I do know that pasting the actual text of build errors, within triple-backticks
like this
is a much better way to go about troubleshooting though. Not nearly enough context in a small image
@mikehardy Actually i have linked facebook sdk on react-native version 0.59.3 and after upgrading to 0.60.5 i am getting this error after installing the pod from and while build FBSDK i get this error.
Parse issue Expected ','
from OIDExternalUserAgentIOSCustomBrowser.h
I have added use_frameworks!
in my pod file and i am currently on Xcode verison 10.3
Unfortunately I don't think that has anything to do with this issue. You'd probably be better opening a fresh issue following whatever template exists in this repository, so full details exist to troubleshoot.
thanks, I will open another fresh issue.
by the way i am also getting this error along with this
Expanded from macro 'API_UNAVAILABLE
I've tried to install FBSDKCoreKit by pod install
. Then pod installed 5.12.0 and XCode show the same error. I fixed by changing Podfile at line
pod 'FBSDKCoreKit'
to
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
as Manually link the library on iOS in README.md, then pod update
. The pod installed 5.8.0 instead and it work well right now.
"react": "16.8.6"
"react-native": "0.60.5"
"react-native-fbsdk": "1.1.1"
in podfile just change to this
pod 'FBSDKCoreKit', '5.8.0'
pod 'FBSDKLoginKit', '5.8.0'
pod 'FBSDKShareKit', '5.8.0'
Im on 1.1.1 and still have the problem
@appify-waheed i am facing same issue ! any solutions to this ?
@janicduplessis this is very strange to me, per my comment above I was sure that upstream Pods >= 5.12 would fix it, as they had merged a fix, but with Pods 5.14.0 (current as of this typing) the build still breaks :thinking:
That means the expected fix was not the fix and I suppose there is still a problem here?
Adding pod 'FBSDKCoreKit', '~> 5.8', :modular_headers => true
to Pod file worked for me
Hi fellow tinkerers,
Unfortunately the steps above all failed for me. I managed to integrate react-native-fbsdk@1.1.2 into a react-native@0.61.5 app by doing the following after yarn add react-native-fbsdk@1.1.2
s.subspec 'Core' do |ss|
ss.dependency 'FBSDKCoreKit', '~> 4.38.0'
ss.source_files = 'ios/RCTFBSDK/core/*.{h,m}'
end
s.subspec 'Login' do |ss|
ss.dependency 'FBSDKLoginKit', '~> 4.38.0'
ss.source_files = 'ios/RCTFBSDK/login/*.{h,m}'
end
s.subspec 'Share' do |ss|
ss.dependency 'FBSDKShareKit', '~> 4.38.0'
ss.source_files = 'ios/RCTFBSDK/share/*.{h,m}'
end
pod 'FBSDKCoreKit', '~> 4.38.0'
pod 'FBSDKLoginKit', '~> 4.38.0'
RCT_EXPORT_METHOD(logInWithPermissions:(NSArray<NSString *> *)permissions
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
[_loginManager logInWithReadPermissions:@[@"email"] fromViewController:nil handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
if (error) {
reject(@"FacebookSDK", @"Login Failed", error);
} else {
resolve(RCTBuildResultDictionary(result));
}
}];
};
At this point, I ran on my device and was able to login to Facebook successfully. Hope this helps someone.
🐛 Bug Report
Tried on both xcode 11 and xcode 10, and legacy build mode
To Reproduce
https://github.com/zhigang1992/react-native-fbsdk-build-error
and
and
Expected Behavior
Should be able to compile
Code Example
https://github.com/zhigang1992/react-native-fbsdk-build-error
Environment