You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use_frameworks! :linkage => :static # ADDED NEW
$RNFirebaseAsStaticFramework = true # ADDED NEW
.
.
.
target 'ImageNotifi' do
use_frameworks! # ADDED NEW
pod 'Firebase/Messaging'
end
I have been struggling to successfully build iOS using Xcode after upgrading RNFirebase from v14 to v21, I have tried a number solutions I could find on internet but apparently none seems to work for this particular issue.
Tried cleaning whole project caches, the standard deintegrate, clean and rebuild trick
Tried manually adding FirebaseCodeInternal and FirebaseCore-static in frameworks
Tried using simple use_frameworks! instead of use_frameworks! :linkage => :static
Apparently nothing seems to work.
There is a similar issue I could find in flutter firebase integration firebase/firebase-ios-sdk#11464, where @mikehardy shared some thoughts on the issue, but nothing that could help me root out issue in my case with RN Firebase.
requireFile.join(File.dirname(`node --print "require.resolve('expo/package.json')"`),"scripts/autolinking")# Resolve react_native_pods.rb with node to allow for hoistingrequirePod::Executable.execute_command('node',['-p','require.resolve( "react-native/scripts/react_native_pods.rb", {paths: [process.argv[1]]}, )',__dir__]).stripplatform:ios,min_ios_version_supportedprepare_react_native_project!# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded## To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`# ```js# module.exports = {# dependencies: {# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),# ```flipper_config=ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabledlinkage=ENV['USE_FRAMEWORKS']iflinkage != nilPod::UI.puts"Configuring Pod with #{linkage}ally linked Frameworks".greenuse_frameworks!:linkage=>linkage.to_symenduse_frameworks!:linkage=>:static# SUPER IMPORTANT
$RNFirebaseAsStaticFramework =truetarget'Ecency'douse_expo_modules!post_integratedo |installer|
beginexpo_patch_react_imports!(installer)rescue=>ePod::UI.warneendendconfig=use_native_modules!permissions_path='../node_modules/react-native-permissions/ios'pod'Permission-Camera',:path=>"#{permissions_path}/Camera"# Pods for Ecencyuse_react_native!(:path=>config[:reactNativePath],# Enables Flipper.## Note that if you have use_frameworks! enabled, Flipper will not work and# you should disable the next line.# :flipper_configuration => flipper_config,# An absolute path to your application root.:app_path=>"#{Pod::Config.instance.installation_root}/..")target'EcencyTests'doinherit!:complete# Pods for testingend# Convert all permission pods into static librariespre_installdo |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method,:verify_no_static_framework_transitive_dependencies){}installer.pod_targets.eachdo |pod|
ifpod.name.eql?('RNPermissions') || pod.name.start_with?('Permission-')defpod.build_type;# Uncomment the line corresponding to your CocoaPods versionPod::BuildType.static_library# >= 1.9# Pod::Target::BuildType.static_library # < 1.9endendendendpost_installdo |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202react_native_post_install(installer,config[:reactNativePath],:mac_catalyst_enabled=>false)installer.pods_project.targets.eachdo |target|
#workarounf for xcode 14 archive signing issue#ref:https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1201464693iftarget.respond_to?(:product_type)andtarget.product_type == "com.apple.product-type.bundle"target.build_configurations.eachdo |config|
config.build_settings['CODE_SIGNING_ALLOWED']='NO'endendtarget.build_configurations.eachdo |config|
config.build_settings["ONLY_ACTIVE_ARCH"]="NO"config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)','_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']end#this workaround resolves duplicate symbolds caused by GCDAsyncSocket inclusion in TcpSocketsiftarget.name == 'TcpSockets'source_files=target.source_build_phase.filesgcd_async_socket=source_files[0]#First file in build phases is GCDAsyncSocket.m, chage index if not the caseputs"Deleting source file #{gcd_async_socket.inspect} from target #{target.inspect}."source_files.deletegcd_async_socketend#workaround for resolving React-Codegen build failure on Xcode 14.3 (iOS 16.4) simulators - 'value' is unavailableiftarget.name == 'React-Codegen'target.build_configurations.eachdo |config|
config.build_settings.delete'IPHONEOS_DEPLOYMENT_TARGET'endendendendendtarget'ImageNotifi'douse_frameworks!pod'Firebase/Messaging'end
AppDelegate.m:
// N/A
Android
Click To Expand
Have you converted to AndroidX?
my application is an AndroidX application?
I am using android/gradle.settingsjetifier=true for Android compatibility?
I am using the NPM package jetifier for react-native compatibility?
android/build.gradle:
// N/A
android/app/build.gradle:
// N/A
android/settings.gradle:
// N/A
MainApplication.java:
// N/A
AndroidManifest.xml:
<!-- N/A -->
Environment
Click To Expand
react-native info output:
System:
OS: macOS 14.2.1
CPU: (8) arm64 Apple M1
Memory: 97.88 MB / 8.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.9.0
path: ~/.nvm/versions/node/v20.9.0/bin/node
Yarn:
version: 1.22.22
path: ~/Documents/ReactNativeProjects/ecency-mobile/node_modules/.bin/yarn
npm:
version: 10.1.0
path: ~/.nvm/versions/node/v20.9.0/bin/npm
Watchman:
version: 2024.07.01.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK:
API Levels:
- "28"
- "30"
- "31"
- "33"
- "34"
- "35"
Build Tools:
- 28.0.3
- 29.0.2
- 29.0.3
- 30.0.2
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 33.0.2
- 34.0.0
- 35.0.0
- 35.0.0
- 35.0.0
System Images:
- android-30 | Google Play ARM 64 v8a
- android-31 | Google APIs ARM 64 v8a
- android-31 | Google Play ARM 64 v8a
- android-32 | Google APIs ARM 64 v8a
- android-32 | Google Play ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-Baklava | Pre-Release 16 KB Page Size Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2024.1 AI-241.18034.62.2411.12169540
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.5
path: /usr/bin/javac
Ruby:
version: 3.3.0
path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Platform that you're experiencing the issue on:
iOS
Android
iOS but have not tested behavior on Android
Android but have not tested behavior on iOS
Both
react-native-firebase version you're using that has this issue:
21.0.6
Firebase module(s) you're using that has the issue:
As mentioned on the comment you linked, these problems are notoriously difficult to diagnose. I have basically given up trying, the number of people that ask for support with an infinite variety of modules and a difficult-to-understand skew of non-current versions of everything means that each one is different - creating a nearly infinite demand for support in a finite world.
So I go the other way. I demonstrate exactly how to build a project from start to finish, with a script that you can run and will result in a project that runs.
What's the difference between that script's results and your project (besides that the result of the script will build correctly)? I have no idea, but a comparison between the two - and or taking the script result and carefully adding things you're trying until you find something may show the answer
Issue
Facing build issue on iOS while upgrading RN Firebase from v14.12.0 - v21.0.6 .
Changes to package.json
Changes to Podfile
I have been struggling to successfully build iOS using Xcode after upgrading RNFirebase from v14 to v21, I have tried a number solutions I could find on internet but apparently none seems to work for this particular issue.
deintegrate
,clean
andrebuild
trickFirebaseCodeInternal
andFirebaseCore-static
in frameworksuse_frameworks!
instead ofuse_frameworks! :linkage => :static
Apparently nothing seems to work.
There is a similar issue I could find in flutter firebase integration firebase/firebase-ios-sdk#11464, where @mikehardy shared some thoughts on the issue, but nothing that could help me root out issue in my case with RN Firebase.
Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:21.0.6
Firebase
module(s) you're using that has the issue:_FIRHeartbeatController
TypeScript
?Y/N
&VERSION
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: