iOS : 'folly/folly-config.h' file not found

This issue has been tracked since 2022-09-22.

Description

Hi, I use expo to build native application android and ios.
I have a bare workflow project and I update my expo sdk 46 from 44.
After that, I update all the modules in my package.json and when I launch expo start it’s good.

But when I try to make a build with eas build, I get two errors and I can’t fix them.
I try cleaning pods, cleaning build folder and nothing works.

image

Can you help me ?

Thanks

Version

0.69.5

Output of npx react-native info

System:
OS: macOS 12.6
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Memory: 368.16 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.13.2 - /usr/local/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.19.2 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 14.0/14A309 - /usr/bin/xcodebuild
Languages:
Java: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: 0.69.5 => 0.69.5
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

To reproduce this bug, I do an eas build -p ios to my project and that's it.

Snack, code example, screenshot, or link to a repository

Here we have my AppDelegate.mm :
`#import "AppDelegate.h"
// @generated begin react-native-maps-import - expo prebuild (DO NOT MODIFY) sync-f2f83125c99c0d74b42a2612947510c4e08c423a
#if __has_include(<GoogleMaps/GoogleMaps.h>)
#import <GoogleMaps/GoogleMaps.h>
#endif
// @generated end react-native-maps-import

#if defined(EX_DEV_MENU_ENABLED)
@import EXDevMenu;
#endif

#if defined(EX_DEV_LAUNCHER_ENABLED)
#include <EXDevLauncher/EXDevLauncherController.h>
#import <EXUpdates/EXUpdatesDevLauncherController.h>
#endif

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTLinkingManager.h>
#import <React/RCTConvert.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>

#import <React/RCTAppSetupUtils.h>

#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#import <React/RCTSurfacePresenter.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>
#import <ReactCommon/RCTTurboModuleManager.h>

#import <react/config/ReactNativeConfig.h>

static NSString *const kRNConcurrentRoot = @"concurrentRoot";

@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
RCTTurboModuleManager *_turboModuleManager;
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
std::shared_ptr _reactNativeConfig;
facebook::react::ContextContainer::Shared _contextContainer;
}
@EnD
#endif

@implementation AppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    RCTAppSetupPrepareApp(application);

// @generated begin react-native-maps-init - expo prebuild (DO NOT MODIFY) sync-99607ce40d10e3e53111903c05b1ea58ccbd133c
#if __has_include(<GoogleMaps/GoogleMaps.h>)
[GMSServices provideAPIKey:@"AIzaSyDMg-Pv9yL1iHthNrG7ak2qLWy0Z-lEBes"];
#endif
// @generated end react-native-maps-init
RCTBridge *bridge = [self.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions];

#if RCT_NEW_ARCH_ENABLED
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif

NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = [self.reactDelegate createRootViewWithBridge:bridge moduleName:@"main" initialProperties:initProps];

rootView.backgroundColor = [UIColor whiteColor];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [self.reactDelegate createRootViewController];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];

[super application:application didFinishLaunchingWithOptions:launchOptions];

return YES;
}

  • (NSArray<id> *)extraModulesForBridge:(RCTBridge *)bridge
    {
    // If you'd like to export some custom RCTBridgeModules, add them here!
    return @[];
    }

/// This method controls whether the concurrentRootfeature of React18 is turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: true if the concurrentRoot feture is enabled. Otherwise, it returns false.

  • (BOOL)concurrentRootEnabled
    {
    // Switch this bool to turn on and off the concurrent root
    return true;
    }

  • (NSDictionary *)prepareInitialProps
    {
    NSMutableDictionary *initProps = [NSMutableDictionary new];
    #if RCT_NEW_ARCH_ENABLED
    initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
    #endif
    return initProps;
    }

  • (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
    {
    #if DEBUG
    return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
    #else
    return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
    #endif
    }

// Linking API

  • (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];
    }

// Universal Links

  • (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id> * _Nullable))restorationHandler {
    BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
    return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result;
    }

// Required to register for notifications

  • (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
    {
    [RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings];
    }
    // Required for the register event.
  • (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
    {
    [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
    }
    // Required for the notification event. You must call the completion handler after handling the remote notification.
  • (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
    {
    [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
    }
    // Required for the registrationError event.
  • (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
    {
    [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
    }
    // IOS 10+ Required for localNotification event
  • (void)userNotificationCenter:(UNUserNotificationCenter *)center
    didReceiveNotificationResponse:(UNNotificationResponse *)response
    withCompletionHandler:(void (^)(void))completionHandler
    {
    [RNCPushNotificationIOS didReceiveNotificationResponse:response];
    completionHandler();
    }
    // IOS 4-10 Required for the localNotification event.
  • (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
    {
    [RNCPushNotificationIOS didReceiveLocalNotification:notification];
    }
    //Called when a notification is delivered to a foreground app.
    -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
    {
    completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
    }

#if RCT_NEW_ARCH_ENABLED

#pragma mark RCTTurboModuleManagerDelegate

  • (Class)getModuleClassFromName:(const char *)name
    {
    return RCTCoreModulesClassProvider(name);
    }

  • (std::shared_ptrfacebook::react::TurboModule)getTurboModule:(const std::string &)name
    jsInvoker:(std::shared_ptrfacebook::react::CallInvoker)jsInvoker
    {
    return nullptr;
    }

  • (std::shared_ptrfacebook::react::TurboModule)getTurboModule:(const std::string &)name
    initParams:
    (const facebook::react::ObjCTurboModule::InitParams &)params
    {
    return nullptr;
    }

  • (id)getModuleInstanceFromClass:(Class)moduleClass
    {
    return RCTAppSetupDefaultModuleFromClass(moduleClass);
    }

#endif

@end`

cortinico wrote this answer on 2022-09-24

Hi, I use expo to build native application android and ios. I have a bare workflow project and I update my expo sdk 46 from 44. After that, I update all the modules in my package.json and when I launch expo start it’s good.

Hi @tiborelsan
Thanks for reporting this issue.

It seems like this issue is actually unrelated to React Native core but related to Expo. Please open this issue against this other repository:

https://github.com/expo/expo/issues

I'll be closing this, but feel free to reopen if the other repo points back to us as a issue in the core of React Native.

More Details About Repo
Owner Name facebook
Repo Name react-native
Full Name facebook/react-native
Language JavaScript
Created Date 2015-01-09
Updated Date 2022-10-03
Star Count 105144
Watcher Count 3666
Fork Count 22469
Issue Count 2232

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date