i am using react native - 0.68.3
"@react-native-firebase/app": "^17.4.2",
"@react-native-firebase/messaging": "^17.4.2",
Undefined symbol: _OBJCCLASS$_RNFBJSONUndefined symbol: _OBJCCLASS$_RNFBRCTEventEmitterUndefined symbol: _OBJCCLASS$_RNFBSharedUtilsLinker command failed with exit code 1 (use -v to see invocation)
this is my podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'cloud_suryalog' do
config = use_native_modules!
use_frameworks!
rn_maps_path = '../node_modules/react-native-maps'
pod 'react-native-google-maps', :path => rn_maps_path
pod 'Google-Maps-iOS-Utils'
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'Firebase/Messaging', :modular_headers => true
pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios'
pod 'react-native-charts-wrapper', :path => '../node_modules/react-native-charts-wrapper'
pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
post_install do |installer|
This is also important AND MUST BE IN SAME ORDER
react_native_post_install(installer)
installer.pods_project.targets.each do |target|
if target.name == 'react-native-google-maps'
target.build_configurations.each do |config|
config.build_settings['CLANG_ENABLE_MODULES'] = 'No'
config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
end
end
end
# __apply_Xcode_12_5_M1_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Disable arm64 builds for the simulator
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
end
end
//Called when a notification is delivered to a foreground app.
-(void)userNotificationCenter:(UNUserNotificationCenter )center willPresentNotification:(UNNotification )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
i am using react native - 0.68.3 "@react-native-firebase/app": "^17.4.2", "@react-native-firebase/messaging": "^17.4.2",
Undefined symbol: _OBJCCLASS$_RNFBJSONUndefined symbol: _OBJCCLASS$_RNFBRCTEventEmitterUndefined symbol: _OBJCCLASS$_RNFBSharedUtilsLinker command failed with exit code 1 (use -v to see invocation)
this is my podfile require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '13.0' install! 'cocoapods', :deterministic_uuids => false
$RNFirebaseAsStaticFramework = true
target 'cloud_suryalog' do config = use_native_modules!
use_frameworks!
rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path pod 'Google-Maps-iOS-Utils' pod 'Firebase', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'Firebase/Messaging', :modular_headers => true pod 'RNCPushNotificationIOS', :path => '../node_modules/@react-native-community/push-notification-ios' pod 'react-native-charts-wrapper', :path => '../node_modules/react-native-charts-wrapper' pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context' pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
Flags change depending on the env values.
flags = get_default_flags()
use_react_native!( :path => config[:reactNativePath],
to enable hermes on iOS, change
false
totrue
and then install pods)
pod 'RNFBMessaging', :path => '../node_modules/@react-native-firebase/messaging'
target 'cloud_suryalogTests' do inherit! :complete
Pods for testing
end
pod 'react-native-maps', :path => '../node_modules/react-native-maps'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
pod 'RNSVG', :path => '../node_modules/react-native-svg'
pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-async-storage/async-storage'
pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'RNCCheckbox', :path => '../node_modules/@react-native-community/checkbox'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker'
pod 'react-native-pager-view', :path => '../node_modules/react-native-pager-view'
This is the whole magic starts # Hit build times and times and which library ever failing add here
$static_framework = [] $static_framework += [ 'react-native-maps', 'react-native-google-maps', 'Google-Maps-iOS-Utils', 'RNPermissions', 'Permission-LocationWhenInUse', ]
** THIS IS THE MAGIC **
pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} installer.pod_targets.each do |pod| if $static_framework.include?(pod.name) def pod.build_type; Pod::BuildType.static_library end end end end
post_install do |installer|
This is also important AND MUST BE IN SAME ORDER
end end
this is my appdelegate.mm
import "AppDelegate.h"
import <React/RCTBridge.h>
import <React/RCTBundleURLProvider.h>
import <React/RCTRootView.h>
import <GoogleMaps/GoogleMaps.h>
import
import <UserNotifications/UserNotifications.h>
import
import
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>
@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 { [GMSServices provideAPIKey:@"AIzaSyDoz7Q98dxh8CNhgeF_ig1FM0JgvxCfwxE"];
if ([FIRApp defaultApp] == nil) { [FIRApp configure]; }
if (@available(iOS 10.0, )) { 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]; }); } }]; } else { UIUserNotificationType allNotificationTypes = (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge); UIUserNotificationSettings settings = [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; [[UIApplication sharedApplication] registerForRemoteNotifications]; }
RCTAppSetupPrepareApp(application);
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
if RCT_NEW_ARCH_ENABLED
_contextContainer = std::make_shared();
_reactNativeConfig = std::make_shared();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
endif
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"cloud_suryalog", nil);
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];
// Define UNUserNotificationCenter UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self;
return YES; }
//Called when a notification is delivered to a foreground app. -(void)userNotificationCenter:(UNUserNotificationCenter )center willPresentNotification:(UNNotification )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge); }
// 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]; }
// Required for localNotification event
(void)userNotificationCenter:(UNUserNotificationCenter )center didReceiveNotificationResponse:(UNNotificationResponse )response withCompletionHandler:(void (^)(void))completionHandler { [RNCPushNotificationIOS didReceiveNotificationResponse:response]; }
(NSURL )sourceURLForBridge:(RCTBridge )bridge {
if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
endif
}
if RCT_NEW_ARCH_ENABLED
pragma mark - RCTCxxBridgeDelegate
pragma mark RCTTurboModuleManagerDelegate
(Class)getModuleClassFromName:(const char *)name { return RCTCoreModulesClassProvider(name); }
(std::shared_ptr)getTurboModule:(const std::string &)name
jsInvoker:(std::shared_ptr)jsInvoker
{
return nullptr;
}
(std::shared_ptr)getTurboModule:(const std::string &)name
initParams:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return nullptr;
}
(id)getModuleInstanceFromClass:(Class)moduleClass
{
return RCTAppSetupDefaultModuleFromClass(moduleClass);
}
endif
@end