-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IOS] App Crash "dyld" error Library not loaded / upstream issue it seems #324
Comments
Actually there are no such files in usr/lib/swift. In which way the FB-libraries should get into this folder? |
Hey, this is a mess, in your Podfile: pod 'GoogleSignIn', '> 6.2.2'
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'Mindbox'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBSDKGamingServicesKit', '> 15.0.0'
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
No idea what all the mindbox stuff is but your build failure is going to be a local problem in your local project and not our responsibility We provide what is in effect a minimal example of integration + build, and it works successfully (https://stackoverflow.com/help/minimal-reproducible-example) It's our example, and it's built by a script even, so you can try it yourself starting with Read that script and all the comments in it, they are useful |
I've got the same error mentioned above although my Podfile is never touched, and everything is kept as the app was just initialized. |
thank man im try to downgrade lib version |
Everything is back to normal after I've downgraded back to v10.1.0 |
So our example script here is a minimal reproducible example (https://stackoverflow.com/help/minimal-reproducible-example) And it works. So the burden of proof that there is an issue is on you, those having the problem. Please also note that versions of everything are important (your Xcode, your pod version, your macOS and iOS versions where this happens, react-native versions, version of this library etc - https://stackoverflow.com/help/how-to-ask) No comments here will help move this forward without a minimal reproducible example that shows the problem, wth information needed to run it and reproduce it. Efficiently triaging issues and finding root causes is real work but it is how to move things forward. If anyone makes the effort, we might be able to pin this down to the exact reason it happens. Until then, the only reproducible example I've got is one that works. |
Dont know why, but downgrading to 8.0.0 has helped me. Maybe the problem was in mismatch between differents libs, pods etc. However, big thank to you, @mikehardy , for your advices and your creation!) |
Oh that looks really subtle - I wonder what we need to do here in order to handle that? 🤔 here are the frameworks they mention: facebook/facebook-ios-sdk#2121 (comment) But I thought we brought all of them in our podspec thus they should all be embedded already. I dunno - I still have no problem in a release version personally so I cannot triage. Good link though @EduCarloto |
This appears to be an upstream issue but it is affecting folks and generating duplicate issues. Going to reopen and pin it |
FYI, for anyone else googling... Adding those FBSDKCoreKit, CoreKit_Basics fixed this for me, but only when including the GamingServices one - to FrameWorks, Libraries and Embedded Content. from facebook/facebook-ios-sdk#2121 (comment) This is all with a fresh new build on the latest RN (0.70) - as I'm porting my existing app over, and switching to this lib instead of the original react-native-fbsdk one. Let me know if/what you want to see from my project. |
@Pashkagreen @mikehardy Was this closed by mistake? Still seems to be occurring whenever I upgrade to >v11 |
Original poster closed it but it does not seem to be resolved |
@KrisLau I was able to upgrade react-native-fbsdk-next to v 12 by linking those 3 frameworks you mentioned and also changing my platform in my Podfile to: |
🤔 so at this point, we have a (kind of terrible looking, if I'm honest, but that is not your fault..) workaround, or otherwise it is perhaps best to stay on a previous version until the upstream SDK has some resolution I suppose. I'm sad this is happening but it still does not really seem to be in the control of this module. Unless perhaps we could do some Podfile (or, from a module perspective: podspec) magic to get those frameworks linked for people as part of the normal pod install process? |
Out of interest, could you explain the issue, just to make all this less of a blackbox/black magic, for simple folk like me. It'd be nice to understand just a little bit of why this is failing, especially if it may ever happen in the future, to save hours of Googling. Pods, Podspec, linking, etc. just a quick overview would be great. |
Sorry, I don't have the time for that. Each of the subjects is the kind of thing that requires actual reading and there's no shortcut to the actual knowledge as far as I know |
Is that any stable version of react-native-fbsdk-next can be used right now? |
@jackchengck either downgrade to v10 or follow the workaround: |
i am facing the same issue. I am using Hackintosh, maybe it is the issue ? @Pashkagreen |
Hi gays. I resolved problem. I add addToAllTargets="true"
if file FacebookSDK\Plugins\Editor\Dependencies.xml |
same error .... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hello! |
I may be mistaken but that looks completely unrelated, it's nothing to do with FBSDK. |
Hi, yes it is, there is no FBSDK |
Just updated cocoapods to latest version (1.12.1 now) and pod install again then the issue was gone guys |
I confirm that too, I was able to remove the embedding and signing in xcode and it all works fine. |
I too just updated cocoapods to the latest version (1.14.3 now) and then the issue was gone.
Then in xcode run the app on a physical device. It worked.
|
🐛 Bug Report
Hello guys. After adding all the staff im trying to launch my application, then it build successfully, and then immediately crashes, because due to stacktrace it cannot find FB libraries. Please help me, I know that the reason is in paths to libs but dont know how to fix it. Attach my code below
To Reproduce
Add everything following the docs
-> build project
Expected Behavior
Successful app launching
Code Example
Error-trace in Xcode:
dyld[14149]: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
Referenced from: /Users/admin/Library/Developer/CoreSimulator/Devices/2309C386-5A39-46F4-86BD-454E538C473F/data/Containers/Bundle/Application/1F10C791-B1D9-492F-8D15-D94DC3B1FB97/bkkz.app/bkkz
Reason: tried: '/Users/admin/Library/Developer/Xcode/DerivedData/bkkz-dfnyardsrennayetefqfyxjjgtud/Build/Products/Debug-iphonesimulator/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Users/admin/Library/Developer/Xcode/DerivedData/bkkz-dfnyardsrennayetefqfyxjjgtud/Build/Products/Debug-iphonesimulator/PackageFrameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file),
My Podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
def mindbox_notifications
pod 'MindboxNotifications'
end
platform :ios, '12.0'
target 'bkkz' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change
false
totrue
and then install pods:hermes_enabled => true
)
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
pod 'GoogleSignIn', '
> 6.2.2'> 15.0.0'pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'Mindbox'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBSDKGamingServicesKit', '
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'react-native-appsflyer', :path => '../node_modules/react-native-appsflyer'
target 'bkkzTests' do
inherit! :complete
# Pods for testing
end
Note that if you have use_frameworks! enabled, Flipper will not work and
you should disable the next line.
use_flipper!({ 'Flipper-Folly' => '2.3.0' })
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
target 'MindboxNotificationServiceExtension' do
mindbox_notifications
end
target 'MindboxNotificationContentExtension' do
mindbox_notifications
end
My AppDelegate:
#import <Firebase.h>
#import "AppDelegate.h"
#import <React/RCTLinkingManager.h>
#import <RNAppsFlyer.h>
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <FBSDKCoreKit/FBSDKCoreKit-swift.h>
#import <RNGoogleSignin/RNGoogleSignin.h>
#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
#import <YandexMapKit/YMKMapKitFactory.h>
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
[client addPlugin:[FlipperKitReactPlugin new]];
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[client start];
}
#endif
@import Mindbox;
@import MindboxSdk;
@implementation AppDelegate
{
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
#ifdef FB_SONARKIT_ENABLED
InitializeFlipper(application);
#endif
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"bkkz"
initialProperties:nil];
// MINDBOX INTEGRATION
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
[center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error) {
if (!error) {
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] registerForRemoteNotifications];
[[Mindbox shared] notificationsRequestAuthorizationWithGranted:granted];
});
}
else {
NSLog(@"NotificationsRequestAuthorization failed with error: %@", error.localizedDescription);
}
}];
// MINDBOX INTEGRATION
if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
[[Mindbox shared] registerBGTasks];
}
else {
rootView.backgroundColor = [UIColor whiteColor];
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
}
// MINDBOX INTEGRATION
TrackVisitData *data = [[TrackVisitData alloc] init];
data.launchOptions = launchOptions;
[[Mindbox shared] trackWithData:data];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
// MINDBOX INTEGRATION
TrackVisitData *data = [[TrackVisitData alloc] init];
data.universalLink = userActivity;
[[Mindbox shared] trackWithData:data];
return YES;
}
// MINDBOX INTEGRATION
completionHandler(UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionSound | UNNotificationPresentationOptionBadge);
}
// MINDBOX INTEGRATION
[[Mindbox shared] apnsTokenUpdateWithDeviceToken:deviceToken];
}
// MINDBOX INTEGRATION
[MindboxJsDelivery emitEvent:response];
[[Mindbox shared] pushClickedWithResponse:response];
TrackVisitData *data = [[TrackVisitData alloc] init];
data.push = response;
[[Mindbox shared] trackWithData:data];
completionHandler();
}
// MINDBOX INTEGRATION
(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
[[Mindbox shared] application:application performFetchWithCompletionHandler:completionHandler];
}
(BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
if ([[FBSDKApplicationDelegate sharedInstance] application:application openURL:url options:options]) {
return YES;
}
if ([RNGoogleSignin application:application openURL:url options:options]) {
return YES;
}
if ([RCTLinkingManager application:application openURL:url options:options]) {
return YES;
}
[[AppsFlyerAttribution shared] handleOpenUrl:url options:options];
return NO;
}
@EnD
Also have added a bridging-header and try antoher variant with ~~~ installer.~~ in podfile, but didnt help.
Attach my settings in project build settings:
Environment
System:
OS: macOS 12.4
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 82.40 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - /usr/local/bin/node
Yarn: 1.22.18 - ~/Desktop/bk-kz-mobile/node_modules/.bin/yarn
npm: 8.3.1 - /usr/local/bin/npm
Watchman: 2022.06.06.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 13.2/13C90 - /usr/bin/xcodebuild
Languages:
Java: 15.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.66.4 => 0.66.4
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
The text was updated successfully, but these errors were encountered: