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
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'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
These days I'm upgrading the react-native application from version 0.61.5 to 0.68.2.
With a few modified Gradle files and minor configuration adjustments, the Android application is currently functioning without any issues. But the iOS application always provides me with some issues after changing the pod file.
I used react native upgrade helper (React Native Upgrade Helper 0.61.5 to 0.68.2) for this upgrade.
my pod File as follows (react-native version 0.68.2 and react version 17.0.1)
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 'HAnalytics' 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}/.."
)
pod 'RNCPushNotificationIOS', :path => '../node_modules/#react-native-community/push-notification-ios'
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-async-storage/async-storage'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
pod 'react-native-document-picker', :path => '../node_modules/react-native-document-picker'
pod 'RNFileViewer', :path => '../node_modules/react-native-file-viewer'
pod 'RNFS', :path => '../node_modules/react-native-fs'
pod 'RNImageCropPicker', :path => '../node_modules/react-native-image-crop-picker'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'react-native-view-shot', :path => '../node_modules/react-native-view-shot'
pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
pod 'RNImageRotate', :path => '../node_modules/react-native-image-rotate'
pod 'react-native-orientation-locker', :path => '../node_modules/react-native-orientation-locker'
pod 'react-native-netinfo', :path => '../node_modules/#react-native-community/netinfo'
pod 'RNKeychain', :path => '../node_modules/react-native-keychain'
pod 'RNAWSCognito', :path => '../node_modules/amazon-cognito-identity-js'
pod 'tipsi-stripe', :path => '../node_modules/tipsi-stripe'
pod 'react-native-webview', :path => '../node_modules/react-native-webview'
pod 'react-native-biometrics', :path => '../node_modules/react-native-biometrics'
target 'HAnalyticsTests' 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|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
Header Search Paths -:
Error -:
There are two solutions I found for this,
1st solution is replace the "react-native-cookie" URL which is deprecated dependency to "#react-native-cookies/cookies" URL to this.
2nd solution is regenerate the iOS folder using following commands.
npm i react-native-eject
npm i #react-native-community/cli // if required use this.
react-native eject
I'm trying to upgrade an inherited project from React Native 0.64 to 0.68. I'm encountering a number of Cocoapod related errors, particularly around React-Codegen which no longer exists as a podspec in the react-native npm package.
The strange thing is I can't any reference online to others having this problem with this particular podspec. This usually means there is something else wrong for which this is a "red herring".
Below is a subset of my Podfile. I'm wondering whether setup has changed such that I no longer need all of these pod dependencies to be explicitly declared? Anyone have any ideas?
pod 'React', :path => '../node_modules/react-native/', :modular_headers => false
pod 'React-Core', :path => '../node_modules/react-native/', :modular_headers => false
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules', :modular_headers => false
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/', :modular_headers => false
pod 'React-perflogger', :path => "../node_modules/react-native/ReactCommon/reactperflogger", :modular_headers => false # dep for DevSupport
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS', :modular_headers => false
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation', :modular_headers => false
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob', :modular_headers => false
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image', :modular_headers => false
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS', :modular_headers => false
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network', :modular_headers => false
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings', :modular_headers => false
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text', :modular_headers => false
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration', :modular_headers => false
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/', :modular_headers => false
pod 'React-ART', :path => '../node_modules/react-native/Libraries/ART', :modular_headers => false # No longer a pod
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact', :modular_headers => false
Add the below statement at the top of your application's Podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
The file which we are requiring in the above step defines a method called use_react_native! which we need in the next step.
Now call the method use_react_native! just before your application's target name in the Podfile as below:
use_react_native!
target 'Example' do
...
end
Finally, run the command pod install at the root of your application
$ pod install
I got it!
apparently react create a script that contains all the standard pods needs for your build
so what I did so far was doing a react-native init to generate the default podfile which was so much different from the old one
here it is
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 'onboardingF2fApp' do
config = use_native_modules!
# Pods for onboardingF2fApp
pod 'GooglePlaces', '3.1.0'
pod 'GooglePlacePicker'
pod 'GoogleMaps'
# 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}/.."
)
end
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
target 'onboardingF2fAppTests' do
inherit! :search_paths
# Pods for testing
end
end
basicaly this script replaces all of the pods in your post
require_relative '../node_modules/react-native/scripts/react_native_pods'
Add this two lines on top of Podfile.
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
Then remove all RCT related pod.
'pod install' & just build project.
This scripts/react_native_pods.rb do all RCT stuff we need.
You can try with a new project with react-native init to see the template Podfile. Its totally diferent than before. I tried on 0.69.5
I don't know what changed but I tried just about any thing and I am always getting this message:
The following build commands failed:
CompileC eveloper/Xcode/DerivedData/xxx-bvxasjfnemrqklbhzatwzolraqjj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper-Folly.build/Objects-normal/x86_64/DistributedMutex.o /WebstormProjects/xxx/ios/Pods/Flipper-Folly/folly/synchronization/DistributedMutex.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
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'
permissions_path = '../node_modules/react-native-permissions/ios'
platform :ios, '10.0'
target 'xxx' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
pod 'RNSVG', :path => '../node_modules/react-native-svg'
pod 'react-native-camera', :path => '../node_modules/react-native-camera'
pod 'RNPermissions', :path => '../node_modules/react-native-permissions'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'RNCPicker', :path => '../node_modules/#react-native-picker/picker'
pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
pod 'RNCAsyncStorage', :path => '../node_modules/#react-native-async-storage/async-storage'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
target 'xxxTests' 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 these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'xxx-tvOS' do
# Pods for xxx-tvOS
target 'xxx-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
Some of the things I tried:
rm Pods + Podfile.lock and pod install
Setting flipper version 0.74.0
I am 100% sure I am opening the project with the xcworkspace and not the xcodeproj
Thanks to anyone who can help