[iOS] AppDelegate.m: 'FlipperKit/FlipperClient.h' file not found
See original GitHub issueThis is what I did:
- Created a new project using react-native 0.62.2 (I had many other problems after upgrading from 0.59.9)
- Copied my source to the new project
- Build failed with the following error:
/Users/user172615/Documents/new-rn62/plumpPlum/ios/plumpPlum/AppDelegate.m:10:9: 'FlipperKit/FlipperClient.h' file not found
- Copied
Post Install processing for Flipperfrom https://github.com/facebook/react-native/issues/28406#issuecomment-604907817 - Build still gives the same error
- Podfile and AppDelegate.m are attached below
React Native version:
System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
Memory: 3.20 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.16.2 - /usr/local/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 11.3/11C29 - /usr/bin/xcodebuild
Languages:
Python: 2.7.16 - /usr/bin/python
npmPackages:
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
Podfile
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
@import SquareReaderSDK;
#if DEBUG
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.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
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if DEBUG
InitializeFlipper(application);
#endif
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"plumpPlum"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[SQRDReaderSDK initializeWithApplicationLaunchOptions:launchOptions];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end
AppDelegate.m
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
@import SquareReaderSDK;
#if DEBUG
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.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
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#if DEBUG
InitializeFlipper(application);
#endif
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"plumpPlum"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[SQRDReaderSDK initializeWithApplicationLaunchOptions:launchOptions];
return YES;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
@end
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
'FlipperKit/FlipperClient.h' file not found - Stack Overflow
ios /Podfile : use_frameworks! And disable this line: # :flipper_configuration => FlipperConfiguration.enabled, cd ios && pod install --repo- ...
Read more >flipperkit/flipperclient.h' file not found - You.com - You.com
Copied my source to the new project; Build failed with the following error: /Users/user172615/Documents/new-rn62/plumpPlum/ios/plumpPlum/AppDelegate.m:10 ...
Read more >React Native - Manual iOS Setup - Flipper
Install the dependencies by running cd ios && pod install . You can now import and initialize Flipper in your AppDelegate. Initialization. The...
Read more >Configure iOS - OpenWeb
Open in Finder the following dir. Pods\SpotImCore\SpotImAdsProvider\ and copy the file GoogleAdsProvider.swift into your app target folder (where AppDelegate.m\ ...
Read more >IOS app is not starting | Apple Developer Forums
Can someone help me with. This is my appdelegate.m file #import <React/RCTBridge.h> #import <React/RCTBundleURLProvider.h> #import <React/RCTRootView.h> ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
figured out how to fix the error. . I wish it works for you !=) Comment out these lines of your code // AppDelegate.m
// Comment out Flipper. … //#import <FlipperKit/FlipperClient.h> //#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h> //#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h> //#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h> //#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h> //#import <FlipperKitReactPlugin/FlipperKitReactPlugin.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]; //}
errors come and go randomly in xcode ^_*