Closed ste7en closed 1 year ago
Relevant issue in the react-native-firebase repo: https://github.com/invertase/react-native-firebase/issues/6800
Same issue here. Have you solved it @kennethlynne?
@aureliopetrone solved with this patch react-native@0.70.6.patch
I applied this using pnpm as package manager but I guess you could easily apply it with yarn or git diff as well!
Description
I'm trying to build my iOS project using static frameworks as required by the Firebase SDK. The react-native version I have is 0.70.5 as required by Expo SDK 47. When building ReactCommon, this error appears:
It looks similar to #34102 but the issue was marked as solved by 0.69.3.
Version
0.70.5
Output of
npx react-native info
Steps to reproduce
The issue appears with a Podfile like this, using the flag
use_frameworks! :linkage => :static
as required by the Firebase SDK:Podfile
```rb require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking") require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods") require File.join(File.dirname(`node --print "require.resolve('@react-native-community/cli-platform-ios/package.json')"`), "native_modules") require File.join(File.dirname(`node --print "require.resolve('@nrwl/react-native/package.json')"`), "nx_post_install") platform :ios, '13.0' install! 'cocoapods', :deterministic_uuids => false project 'App', 'Debug Staging' => :debug, 'Release Staging' => :release, 'Debug Production' => :debug, 'Release Production' => :release, 'AppStore' => :release def shared_pods google_utilites pod 'FBSDKCoreKit', '12.1.0' pod 'FBSDKLoginKit', '12.1.0' pod 'Cosmos', '~> 23.0' pod 'Firebase/Crashlytics', '~> 8.15.0' pod 'Firebase/Messaging', '~> 8.15.0' pod 'Firebase/DynamicLinks', '~> 8.15.0' pod 'Firebase/Performance', '~> 8.15.0' pod 'Firebase/Analytics', '~> 8.15.0' pod 'GoogleSignIn', '6.0.2' pod 'Auth0', '~> 2.3' pod 'CryptoSwift', '1.4.0' pod 'Alamofire', '4.8.1' pod 'SwiftyBeaver', '1.9.5' pod 'ObjectMapper', '3.5.1' pod 'Connectivity', '5.0.0' pod 'Kingfisher', '5.4.0' pod 'UIColor_Hex_Swift', '4.2.0' pod 'SwiftJWT' pod 'ZendeskSupportSDK', '5.0.3' pod 'AlamofireObjectMapper', '5.2.0' pod 'Presentr', '1.9' pod 'SDVersion', '4.3.2' pod 'ReCaptcha', '1.6.0' pod 'UICircularProgressRing', '6.5.0' pod 'google-cast-sdk-no-bluetooth', '4.5.2' pod 'InstantSearch', '~> 5.0' pod 'InstantSearch/Core' pod 'VisualEffectView', '4.1.3' pod 'lottie-ios', '~> 3.5.0' pod 'Charts' pod 'Mixpanel-swift', '3.2.2' pod 'LaunchDarkly', '~> 7.1.0' end def google_utilites pod 'GoogleUtilities/AppDelegateSwizzler' pod 'GoogleUtilities/Environment' pod 'GoogleUtilities/ISASwizzler' pod 'GoogleUtilities/Logger' pod 'GoogleUtilities/MethodSwizzler', '7.7' pod 'GoogleUtilities/NSData+zlib' pod 'GoogleUtilities/Network' pod 'GoogleUtilities/Reachability' pod 'GoogleUtilities/UserDefaults' pod 'Apollo', '0.53.0' pod 'Apollo/SQLite', '0.53.0' end def react_native_pods_install # Flags change depending on the env values. flags = get_default_flags() production = ENV['PRODUCTION'] == "1" use_expo_modules! config = use_native_modules! use_react_native!( :path => config[:reactNativePath], # to enable hermes on iOS, change `false` to `true` and then install pods :production => production, :hermes_enabled => false, :fabric_enabled => false, :flipper_configuration => FlipperConfiguration.disabled, # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) end abstract_target 'BasePods' do use_frameworks! :linkage => :static # If you use `use_frameworks!` in your Podfile, # uncomment the below $static_framework array and also # the pre_install section. This will cause Flipper and # it's dependencies to be built as a static library and all other pods to # be dynamic. # # NOTE Doing this may lead to a broken build if any of these are also # transitive dependencies of other dependencies and are expected # to be built as frameworks. # # $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly', # 'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion', # 'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit', # 'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native', 'Flipper-Fmt' # ] # # 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| 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) installer.pods_project.build_configurations.each do |config| config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO' end # This is necessary for Xcode 14, because it signs resource bundles by default # when building for devices. installer.target_installation_results.pod_target_installation_results .each do |pod_name, target_installation_result| target_installation_result.resource_bundle_targets.each do |resource_bundle_target| resource_bundle_target.build_configurations.each do |config| config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' end end end nx_post_install(installer) end post_integrate do |installer| begin expo_patch_react_imports!(installer) rescue => e Pod::UI.warn e end end target 'App' do config = use_native_modules! react_native_pods_install shared_pods end target 'AppWidget' do google_utilites pod 'Alamofire', '4.8.1' pod 'SwiftJWT' pod 'Auth0', '~> 2.3' pod 'SDVersion', '4.3.2' pod 'Connectivity', '5.0.0' pod 'SwiftyBeaver', '1.9.5' pod 'Firebase/Crashlytics', '~> 8.15.0' pod 'Firebase/Analytics', '~> 8.15.0' end target 'AppWidgetExtension' do google_utilites pod 'Alamofire', '4.8.1' pod 'SwiftJWT' pod 'Auth0', '~> 2.3' pod 'SDVersion', '4.3.2' pod 'Connectivity', '5.0.0' pod 'SwiftyBeaver', '1.9.5' pod 'Firebase/Crashlytics', '~> 8.15.0' pod 'Firebase/Analytics', '~> 8.15.0' end end ```Snack, code example, screenshot, or link to a repository
N/A