I am using react native version 0.70.6, My project was running fine util I added pod for camera permission using react-native-permissions.After adding path for camera permission in my pod file i am getting this error
duplicate symbols for architecture x86_64
I have deleted my pods and regenerated and also deleted derived folder but none of the solutions worked.
My pod file looks as following:
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 'JDB_App' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
$RNFirebaseAsStaticFramework = true
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'JDB_AppTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
Related
i'm getting this error in react native for ios when adding firebase storage 'FirebaseStorage/FirebaseStorage-Swift.h' file not found
enter image description here
Libraries i'm using in react native
"#react-native-firebase/app": "^16.7.0",
"#react-native-firebase/auth": "^16.7.0",
"#react-native-firebase/messaging": "^16.7.0",
"#react-native-firebase/storage": "^16.7.0",
My project podfile look like
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
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseAppCheckInterop', :modular_headers => true
pod 'FirebaseAuthInterop', :modular_headers => true
pod 'FirebaseCoreExtension', :modular_headers => true
pod 'GTMSessionFetcher', :modular_headers => true
$RNFirebaseAsStaticFramework = true
target 'schooler' do
config = use_native_modules!
$RNFirebaseAsStaticFramework = true
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'schoolerTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
I did not have any problems with the Android application, I successfully completed all the steps and published my application.
But I am getting an error while running the App in IOS emulator.
I will be glad if you can help me how to solve this problem. thanks
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
production = ENV["PRODUCTION"] == "1"
target 'cmsio' do
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
:production => production,
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'RNFBMessaging', :path => '../node_modules/#react-native-firebase/messaging'
pod 'react-native-google-maps', :path => '../node_modules/react-native-maps'
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'Firebase/Messaging', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'Google-Mobile-Ads-SDK'
$RNFirebaseAsStaticFramework = true
$RNGoogleMobileAdsAsStaticFramework = true
target 'cmsioTests' 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)
end
end
Error Message
The following build commands failed:
CompileC /Users/sirket/Library/Developer/Xcode/DerivedData/cmsio-doadelmxvtbipqeduigsnvnzbamx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFBMessaging.build/Objects-normal/x86_64/RNFBMessagingSerializer.o /Users/sirket/Desktop/android/cmsio/node_modules/#react-native-firebase/messaging/ios/RNFBMessaging/RNFBMessagingSerializer.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNFBMessaging' from project 'Pods')
(1 failure)
Being able to run the application
When I run 'npx react-native run-ios --simulator='iPhone 14'', the build failed with this error:
The following build commands failed:
CompileC /Users/xx/Library/Developer/Xcode/DerivedData/Chatbot-eeojnmlkiuetmccwazfgajbalxbi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNFirebase.build/Objects-normal/arm64/RNFirebaseFirestore.o /Users/xx/Desktop/Chatbot/node_modules/react-native-firebase/ios/RNFirebase/firestore/RNFirebaseFirestore.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNFirebase' from project 'Pods')
(1 failure)
I have tried uninstalling and reinstalling firebase using 'npm (un)install react-native-firebase' and specifying the version of flipper to use. However, the error still persists. I ran 'pod repo update' and 'pod install' afterwards. My Podfile is:
$FirebaseSDKVersion = '9.6.0'
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false
target 'Chatbot' do
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 => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'ChatbotTests' do
inherit! :complete
# Pods for testing
end
pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# use_flipper!()
use_flipper!({ 'Flipper' => '0.162.0' })
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
My react-native versions are: react-native-cli: 2.0.1 & react-native: 0.68.2
My firebase related versions are:
#react-native-firebase/firestore: 16.4.2 & firebase: 9.13.0
Help will be greatly appreciated.
I'm facing this issue when I try to run the app in Xcode. my Xcode version is 13.2.1 (13C100)
-U and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
Here's my podfile
$RNFirebaseAsStaticFramework = true
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
target 'Mcsc' do
use_frameworks!
config = use_native_modules!
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'GoogleMaps'
pod 'RNFBApp', :path => '../node_modules/#react-native-firebase/app'
pod 'GoogleUtilities', :modular_headers => true
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'FirebaseStorage', :modular_headers => true
pod 'FirebaseStorageInternal', :modular_headers => true
pod 'FirebaseAppCheckInterop', :modular_headers => true
pod 'FirebaseAuthInterop', :modular_headers => true
pod 'FirebaseCoreExtension', :modular_headers => true
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
# 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 => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'McscTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
# use_flipper!()
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
def pod.build_type;
# Uncomment the line corresponding to your CocoaPods version
Pod::BuildType.static_library # >= 1.9
# Pod::Target::BuildType.static_library # < 1.9
end
end
end
end
post_install do |installer|
# config.build_settings['ENABLE_BITCODE'] = 'NO'
# Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_12_0/' Pods/RCT-Folly/folly/portability/Time.h`
end
end
Any help would be great! I tried disabling bitcode and it still showed ENABLE_BITCODE=YES in the error message - cleaned my build folder too. Really out of ideas right now.
Bitcode is deprecated in Xcode 14. So, it is perhaps best to simply disable it, then there's no problem. In Podfile in postinstall add these lines
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end
end
In my case I had to remove use_frameworks! and use
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
$RNFirebaseAsStaticFramework = true
instead.
So my Podfile looked like this
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 'opinion' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
$RNFirebaseAsStaticFramework = true
use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'opinionTests' do
inherit! :complete
# Pods for testing
end
post_install do |installer|
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
I'm facing a problem while running Pod install. When it is finished installing all pods, it gets stuck on a loop printing React-core and the paths of these two files .release.xcconfig, .debug.xcconfig.
React-Core
/path/project/ios/Pods/Target Support Files/Pods-project/Pods-project.release.xcconfig
/path/project/ios/Pods/Target Support Files/Pods-project/Pods-project.debug.xcconfig
/path/project/ios/Pods/Target Support Files/Pods-project-projectTests/Pods-project-projectTests.release.xcconfig
/path/project/ios/Pods/Target Support Files/Pods-project-projectTests/Pods-project-projectTests.debug.xcconfig
It was working fine before I clean cache and files.
The previous steps I did to get this problem were:
Cleaning cache with yarn cache clean
Remove pods and Podfile.lock
Run pod install
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, '12.0'
use_frameworks!
pre_install do |installer|
installer.pod_targets.each do |pod|
if pod.name.start_with?('RNFB') || pod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')
def pod.build_type;
Pod::BuildType.static_library # >= 1.9
end
end
end
end
target 'project' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
# react-native-permissions permission handlers
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec"
pod 'Permission-MediaLibrary', :path => "#{permissions_path}/MediaLibrary/Permission-MediaLibrary.podspec"
pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications/Permission-Notifications.podspec"
pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways/Permission-LocationAlways.podspec"
pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse/Permission-LocationWhenInUse.podspec"
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
# pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
# Add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# For Analytics without IDFA collection capability, use this pod instead
# pod ‘Firebase/AnalyticsWithoutAdIdSupport’
# Add the pods for any other Firebase products you want to use in your app
# For example, to use Firebase Authentication and Cloud Firestore
pod 'Firebase/Auth'
pod 'Firebase/Firestore'
pod 'RNSVG', :path => '../node_modules/react-native-svg'
#pod 'react-native-network-info', :path => '../node_modules/react-native-network-info'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNPermissions', :path => '../node_modules/react-native-permissions'
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
target 'project' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
#use_flipper!()
post_install do |installer|
installer.pods_project.targets.each do |target|
react_native_post_install(installer)
target.build_configurations.each do |config|
# some older pods don't support some architectures, anything over iOS 11 resolves that
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
end
hard to tell but it looks like your Podfile is for a recent version of RN but you have some pods manually linked which should support auto linking. Maybe double check the install/setup instructions for the 3rd party libraries you're using.
The solution of my problema was removing this line of code from my podfile:
installer.pods_project.targets.each do |target|
Thank u