facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.36k stars 952 forks source link

Error undefined symbol when running react native IOS after set The Initialization from flipper documentation #3242

Open allandallopez opened 2 years ago

allandallopez commented 2 years ago

Hello guys. So, I want to try to integrate flipper with my react native application project. I tried it on Android its working well, but after I tried to integrate it with IOS, there was a step which is made me unable to run my app again. It's happened when im adding The "Initialization" from the flipper documentation. Here's the code :

#if DEBUG
#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitLayoutPlugin/SKDescriptorMapper.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#endif
#endif

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [self initializeFlipper:application];
  ...
}

- (void) initializeFlipper:(UIApplication *)application {
  #if DEBUG
  #ifdef FB_SONARKIT_ENABLED
    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
  #endif
}

After adding the code on my AppDelegate.m, It's become error like this when run ios : Screen Shot 2022-01-04 at 21 08 51

Additional Information

Link documentation : https://fbflipper.com/docs/getting-started/react-native-ios/

lblasa commented 2 years ago

@allandallopez it seems like the build dependencies are not in place?

Did you update the Podfile? If so, did you run pod install after?

allandallopez commented 2 years ago

@lblasa Yes, After im adding these two line code :

use_flipper!({'Flipper' => '0.127.0'}) and flipper_post_install(installer)

I do run pod install again.

Screen Shot 2022-01-05 at 00 13 46
allandallopez commented 2 years ago

it seems like the build dependencies are not in place?

@lblasa Yes i think so, but dont know how to fix it.

lblasa commented 2 years ago

That is weird, all the missing symbols come from the dependencies which are addeded with Cocoapods. I can see the dependencies being installed but maybe not to the right iOS target?

allandallopez commented 2 years ago

That is weird, all the missing symbols come from the dependencies which are addeded with Cocoapods. I can see the dependencies being installed but maybe not to the right iOS target?

@lblasa Any suggestions from you ? The IOS target that I have to try. Currently my podfile look like this :

Screen Shot 2022-01-19 at 15 43 18

However, i'm still cannot run ios after added the Initialization code from flipper. Iam just be able to install it