Closed numandev1 closed 2 years ago
Hey! π
It looks like you've omitted a few important sections from the issue template.
Please complete Platforms section.
Hey! π
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
Hey @nomi9995, thanks for reporting the issue.
/project/ios/Pods/Headers/Public/hermes-engine/hermes/hermes.h:11:10: 'exception' file not found
/project/ios/Pods/Headers/Private/React-bridging/react/bridging/react/bridging/LongLivedObject.h:10:10: 'memory' file not found
These errors look quite serious and suggest that C++ standard library cannot be found when compiling React sources.
Can you check in Xcode if these files (hermes.h
and LongLivedObject.h
) are recognized as C++ sources?
I would also recommend performing the following steps:
cd ios && rm -rf Podfile.lock Pods
Please let us know if it helps.
edit: Also, most of the dependencies in package.json
don't support Fabric yet.
@tomekzaw I have tried removing Podfile.lock Pods derivedData directory but I am getting the same error
how can I check hermes.h
is a C++ source or not?
how can I check hermes.h is a C++ source or not?
When you open the file in Xcode, on the right side there is "Type" selectbox:
But I cannot find hermes.h
in Xcode. Moreover, even if I open JSCRuntime.h
(which is definitely a C++ header) it says "Default - C Header" π’ So this is not the right way.
Can you temporarily remove all dependencies from your app that do not support Fabric yet? I think this might be the problem.
@tomekzaw It is also showing me "Default - C Header" all three file hermes.h
, LongLivedObject.h
and REAEventDispatcher.h
here you can find hermes.h
ios/Pods/hermes-engine/destroot/include/hermes/hermes.h
My Xcode is lazy. this bug made me soo much tired. I will come back to this bug another day. thanks a lot for your help
the same issue with my project:
Hey @MichDreby, can you share some more details like RN version, Reanimated version etc.?
Hi @tomekzaw, thanks for replying.
Package.json:
"dependencies": {
"@apollo/client": "^3.4.16",
"@expo/react-native-action-sheet": "3.13.0",
"@microsoft/applicationinsights-react-native": "^2.2.9",
"@microsoft/applicationinsights-web": "^2.5.11",
"@notifee/react-native": "^3.0.4",
"@react-native-async-storage/async-storage": "1.17.9",
"@react-native-community/blur": "^3.6.0",
"@react-native-community/cameraroll": "4.0.4",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-community/netinfo": "^6.0.2",
"@react-native-community/progress-bar-android": "^1.0.4",
"@react-native-community/progress-view": "^1.2.4",
"@react-native-community/push-notification-ios": "^1.10.1",
"@react-native-firebase/analytics": "14.11.0",
"@react-native-firebase/app": "14.11.0",
"@react-native-firebase/crashlytics": "14.11.0",
"@react-native-firebase/dynamic-links": "14.11.0",
"@react-native-firebase/messaging": "14.11.0",
"@react-native-picker/picker": "^1.16.8",
"@react-navigation/bottom-tabs": "6.3.2",
"@react-navigation/elements": "1.3.4",
"@react-navigation/material-top-tabs": "6.2.2",
"@react-navigation/native": "6.0.11",
"@react-navigation/native-stack": "6.7.0",
"@react-navigation/stack": "6.2.2",
"@testing-library/react-hooks": "^3.4.2",
"@types/omit-deep-lodash": "^1.1.0",
"@types/react-native-snap-carousel": "^3.8.4",
"@types/string.prototype.matchall": "^4.0.0",
"@types/yup": "^0.29.8",
"apollo-link-http": "^1.5.17",
"apollo-link-queue": "^3.1.0",
"camelcase-keys": "^6.2.2",
"card-validator": "^8.1.0",
"core-js": "^3.12.1",
"date-fns": "2.23.0",
"date-fns-tz": "^1.1.6",
"deprecated-react-native-prop-types": "^2.3.0",
"expo": "46.0.7",
"expo-camera": "12.2.0",
"expo-location": "14.2.2",
"expo-media-library": "14.1.0",
"expo-permissions": "13.2.0",
"formik": "^2.2.1",
"graphql": "^15.3.0",
"graphql-tag": "^2.12.4",
"i18next": "^19.7.0",
"js-base64": "^3.7.2",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.20",
"loglevel": "^1.7.1",
"metro-config": "^0.66.1",
"omit-deep-lodash": "^1.1.5",
"patch-package": "^6.4.7",
"react": "18.0.0",
"react-i18next": "^11.7.3",
"react-native": "0.69.4",
"react-native-video": "^5.2.0",
"react-native-android-downloading-notifications": "0.0.3",
"react-native-android-keyboard-adjust": "^1.2.0",
"react-native-app-auth": "^6.0.1",
"react-native-base64": "^0.2.1",
"react-native-calendars": "1.1284.0",
"react-native-check-app-install": "redpandatronicsuk/react-native-check-app-install",
"react-native-codegen": "0.71.0",
"react-native-date-picker": "^4.2.0",
"react-native-device-info": "^7.0.2",
"react-native-document-picker": "^5.0.3",
"react-native-exception-handler": "^2.10.10",
"react-native-fast-image": "^8.5.11",
"react-native-file-viewer": "^2.1.4",
"react-native-fingerprint-scanner": "^6.0.0",
"react-native-fs": "^2.17.0",
"react-native-gesture-handler": "2.5.0",
"react-native-gradle-plugin": "0.70.1",
"react-native-image-picker": "4.8.4",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-json-tree": "^1.3.0",
"react-native-keyboard-aware-scroll-view": "^0.9.3",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^2.1.4",
"react-native-map-clustering": "^3.4.2",
"react-native-maps": "^1.0.0",
"react-native-orientation-locker": "^1.5.0",
"react-native-map-link": "^2.8.2",
"react-native-masked-text": "^1.13.0",
"react-native-modal": "^13.0.0",
"react-native-pager-view": "^5.4.6",
"react-native-parsed-text": "0.0.22",
"react-native-pdf": "^6.2.2",
"react-native-rate": "^1.2.9",
"react-native-reanimated": "3.0.0-rc.0",
"react-native-render-html": "^5.1.0",
"react-native-safe-area-context": "^3.1.8",
"react-native-screens": "3.15.0",
"react-native-shake": "^5.0.1",
"react-native-size-matters": "^0.4.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-splash-screen": "^3.2.0",
"react-native-status-bar-height": "^2.5.0",
"react-native-svg": "12.1.0",
"react-native-tab-view": "3.1.1",
"react-native-toast-notifications": "^3.2.2",
"react-native-ultimate-config": "4.0.0",
"react-native-uuid": "^2.0.0",
"react-native-webview": "11.22.7",
"requestidlecallback-polyfill": "^1.0.2",
"rn-fetch-blob": "^0.12.0",
"rn-secure-storage": "^2.0.6",
"sendbird": "3.1.17",
"stack-beautifier": "^1.0.2",
"string.prototype.matchall": "^4.0.3",
"uuid-by-string": "^3.0.7",
"victory-core": "^36.2.0",
"victory-native": "^36.2.0",
"yup": "^0.29.3"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/preset-env": "^7.12.1",
"@babel/preset-typescript": "^7.12.1",
"@babel/runtime": "^7.12.5",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@graphql-codegen/cli": "^1.19.1",
"@graphql-codegen/typescript": "^1.17.11",
"@react-native-community/eslint-config": "^1.1.0",
"@storybook/addon-actions": "^6.3.8",
"@storybook/addon-knobs": "^5.3.21",
"@storybook/addon-links": "^6.3.8",
"@storybook/addon-ondevice-actions": "^5.3.23",
"@storybook/addon-ondevice-knobs": "^5.3.25",
"@storybook/addons": "^6.3.8",
"@storybook/react-native": "^5.3.25",
"@storybook/react-native-server": "^5.3.23",
"@testing-library/react-hooks": "^3.7.0",
"@testing-library/react-native": "^7.0.2",
"@types/i18next": "^13.0.0",
"@types/jest": "^26.0.24",
"@types/lodash": "^4.14.165",
"@types/loglevel": "^1.6.3",
"@types/react-gateway": "^2.8.3",
"@types/react-i18next": "^8.1.0",
"@types/react-native": "^0.69.3",
"@types/react-native-dotenv": "^0.2.0",
"@types/react-test-renderer": "^16.9.2",
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"babel-jest": "^26.6.3",
"babel-loader": "^8.1.0",
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-resolve-barrel-files": "0.2.0",
"eslint": "^7.14.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-barrel-files": "./libs/eslint-plugin-barrel-files",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-path": "1.0.1",
"eslint-plugin-react": "^7.21.2",
"eslint-plugin-react-hooks": "^4.0.0",
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-sonarjs": "^0.11.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^4.3.0",
"i18next-scanner": "^2.11.0",
"i18next-scanner-typescript": "^1.0.6",
"jest": "^26.6.3",
"jest-junit": "^12.0.0",
"lint-staged": "^10.4.0",
"metro-react-native-babel-preset": "0.66.2",
"mock-apollo-client": "^1.2.0",
"mockdate": "^3.0.2",
"react-dom": "18.0.0",
"react-native-dotenv": "^2.5.0",
"react-native-svg-transformer": "^0.14.3",
"react-test-renderer": "17.0.2",
"typescript": "^4.1.0"
}
Podfile:
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
target 'AppName' do
use_expo_modules!
post_integrate do |installer|
begin
expo_patch_react_imports!(installer)
rescue => e
Pod::UI.warn e
end
end
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => true,
:fabric_enabled => flags[:fabric_enabled],
:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'AppNameTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
end
end
end
end
AppDelegate.mm:
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <Firebase.h>
#import <React/RCTLinkingManager.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
#import <RNFBMessagingModule.h>
#import <React/RCTAppSetupUtils.h>
#import "Orientation.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";
#endif
#if RCT_NEW_ARCH_ENABLED
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate, UNUserNotificationCenterDelegate, FIRMessagingDelegate> {
RCTTurboModuleManager *_turboModuleManager;
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
facebook::react::ContextContainer::Shared _contextContainer;
}
@end
#else
@interface AppDelegate () <UNUserNotificationCenterDelegate, FIRMessagingDelegate> {}
@end
#endif
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
RCTAppSetupPrepareApp(application);
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
NSDictionary *initProps = [RNFBMessagingModule addCustomPropsToUserProps:nil withLaunchOptions:launchOptions];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"AppName", initProps);
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
[FIRMessaging messaging].delegate = self;
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];
[application registerForRemoteNotifications];
#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
if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
} else {
rootView.backgroundColor = [UIColor whiteColor];
}
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[RNSplashScreen show];
[super application:application didFinishLaunchingWithOptions:launchOptions];
return YES;
}
/// This method controls whether the `concurrentRoot`feature 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];
#ifdef RCT_NEW_ARCH_ENABLED
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
#endif
return initProps;
}
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return [Orientation getOrientation];
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *) options {
if ([self.authorizationFlowManagerDelegate resumeExternalUserAgentFlowWithURL:url])
{
return YES;
}
return [RCTLinkingManager application:app openURL:url options:options];
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
[RNCPushNotificationIOS didReceiveLocalNotification:notification];
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[FIRMessaging messaging].APNSToken = deviceToken;
[RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler
{
[[FIRMessaging messaging] appDidReceiveMessage:userInfo];
completionHandler(UIBackgroundFetchResultNoData);
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler
{
[RNCPushNotificationIOS didReceiveNotificationResponse:response];
NSDictionary *userInfo = response.notification.request.content.userInfo;
[[FIRMessaging messaging] appDidReceiveMessage:userInfo];
completionHandler();
}
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
NSDictionary *userInfo = notification.request.content.userInfo;
[[FIRMessaging messaging] appDidReceiveMessage:userInfo];
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo
fetchCompletionHandler:^void (UIBackgroundFetchResult result){}];
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}
#if RCT_NEW_ARCH_ENABLED
#pragma mark - RCTCxxBridgeDelegate
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
{
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
delegate:self
jsInvoker:bridge.jsCallInvoker];
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
}
#pragma mark RCTTurboModuleManagerDelegate
- (Class)getModuleClassFromName:(const char *)name
{
return RCTCoreModulesClassProvider(name);
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
{
return nullptr;
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
initParams:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return nullptr;
}
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
{
return RCTAppSetupDefaultModuleFromClass(moduleClass);
}
#endif
@end
@tomekzaw here is the repro, i will also try to fix it from repro https://github.com/nomi9995/fabric-reanimated-repro
@tomekzaw I confirm that this error is due to an expo "expo": "46.0.8"
, if I remove this then the project is working good otherwise above error is happening. you can also test repro
@nomi9995 Thanks a lot for the investigation! Also, does Expo already support Fabric?
@tomekzaw I also don't know if Expo 46 supports Fabric or not. let me confirm
@tomekzaw expo 46 does not support fabric. here is the reply from the expo team(@tsapeta).
No, just like many other libraries, there are just a few that support Fabric. However, I can already reveal the news that in SDK47 expo-linear-gradient, video from expo-av and expo-camera will have experimental support for Fabric π
Thanks for the update! Closing the issue as it's not a bug in Reanimated. Looking forward to Fabric support in Expo! π
Description
I was just enabling
NEW_ARCH
byUSE_FABRIC=1 RCT_NEW_ARCH_ENABLED=1 pod install
and getting these errors from Xcode/project/ios/Pods/Headers/Public/hermes-engine/hermes/hermes.h:11:10: 'exception' file not found
/project/ios/Pods/Headers/Private/React-bridging/react/bridging/react/bridging/LongLivedObject.h:10:10: 'memory' file not found
/project/node_modules/react-native-reanimated/ios/REAEventDispatcher.h:2:9: Could not build module 'React'
Noted: when i click on
jump to Defination
for#import <React/RCTEventDispatcher.h>
it is jumping correctly.Steps to reproduce
USE_FABRIC=1 RCT_NEW_ARCH_ENABLED=1 pod install
you can try these versions
Snack or a link to a repository
https://github.com/nomi9995/fabric-reanimated-repro
Reanimated version
3.0.0-rc.0
React Native version
0.69.4
Platforms
iOS
JavaScript runtime
Hermes
Workflow
Expo bare workflow
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
iPhone 13 pro max
Acknowledgements
Yes