Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ios build error when use_frameworks is on and fabric is off #33379

Closed
wants to merge 6 commits into from

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Mar 4, 2022

Summary

when use_frameworks! is on, there are errors like:

'FBReactNativeSpec/FBReactNativeSpec.h' file not found
#import <FBReactNativeSpec/FBReactNativeSpec.h>

this error may come from from f7e4c07c84b6 regression.

when use_frameworks! is on, xcode will search headers from framework directories, the correct imports would be #import <React_Codegen/FBReactNativeSpec/FBReactNativeSpec.h> (xcode will transform dash to underscore, so it is React_Codegen but not React-Codegen). in the other hand, when use_frameworks! is off, the correct import is #import <React-Codegen/FBReactNativeSpec/FBReactNativeSpec.h>.

to make it compatible for both modes, i would propose to use a valid module name for the codegen pod. that is the ReactCodegen. supposedly can define different module name in podspecs either by header-dir or module_name. however, i don't recommend to use these as it has a known issue when DEFINES_MODULE=YES. that's why i use the ReactCodegen name.
Update: to make it compatible for both modes, i merged FBReactNativeSpec and React-Codegen. the final name is FBReactNativeSpec.podspec, so the final valid import will be #import <FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h>. this is specific for header_mappings_dir = '.' mode. to keep the import as original #import <FBReactNativeSpec/FBReactNativeSpec.h>, i removed header_mappings_dir in non-fabric mode. the workaround has a downside where assuming there're no other codegen libraries. otherwise, it may also break imports, e.g. #import <ScreenshotmanagerSpec/ScreenshotmanagerSpec.h> -> #import <FBReactNativeSpec/ScreenshotmanagerSpec.h>.

this fix is specific for old architecture (fabric is off).

when fabric is on, there are other errors from duplicated headers when copying to build folder. the reason is that framework build would try to flatten headers. we have primitives.h in different folders and they would be flattened into React_Fabric.framework/Headers. to be honest, i don't know how to deal with the problem in the meantime, maybe subspecs are not enough, we should separate them from subspecs to dedicated podspecs so that we can have these targets as different frameworks.

Changelog

[iOS] [Fixed] - Fix iOS build error when Podfile use_frameworks! is on and Fabric is off

Test Plan

verify with rn-tester

  1. change fabric_enabled to false in packages/rn-tester/Podfile
  2. USE_FRAMEWORKS=1 pod install
  3. build rn-tester in xcode

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. p: Expo Partner: Expo Partner labels Mar 4, 2022
@react-native-bot react-native-bot added Bug Platform: iOS iOS applications. labels Mar 4, 2022
@analysis-bot
Copy link

analysis-bot commented Mar 4, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 5386364
Branch: main

@analysis-bot
Copy link

analysis-bot commented Mar 4, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,212,663 -1,411
android hermes armeabi-v7a 7,798,788 -1,001
android hermes x86 8,586,077 -1,474
android hermes x86_64 8,536,779 -1,719
android jsc arm64-v8a 9,881,430 -966
android jsc armeabi-v7a 8,852,101 -545
android jsc x86 9,850,921 -1,048
android jsc x86_64 10,445,756 -1,279

Base commit: 5386364
Branch: main

@Kudo Kudo marked this pull request as ready for review March 4, 2022 12:29
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Mar 4, 2022
@mikehardy
Copy link
Contributor

@Kudo this may be an odd request and/or difficult - if so please ignore - but if you still have this file tree open + clean somewhere, I'd love a diff of this so I could apply locally via patch-package and test in my reproduction of the same issue, then I could confirm it works as well

If that's not easy for any reason just let me know, the changes are pretty easy and though it would be slightly more error-prone than a diff / patch-package I could apply them locally as well for testing + confirmation

@Kudo
Copy link
Contributor Author

Kudo commented Mar 4, 2022

@mikehardy thanks for your help. this commit patch should be good enough for you to verify.

@mikehardy
Copy link
Contributor

Oh of course github generates them 🤦 😆

mikehardy added a commit to mikehardy/rnfbdemo that referenced this pull request Mar 4, 2022
@mikehardy
Copy link
Contributor

mikehardy commented Mar 4, 2022

Very tiny differences between the github PR patch and what gets installed in an app, but nothing that should alter validity of test results, here's what it looked like after pulling the patch down and applying it manually inside node_modules against react-native 0.68.0-rc.2:


mike@osxvm-little:~/work/Invertase/rnfbdemo/rnfbdemo/node_modules/react-native (rn68) % patch -p1 < ../../../react-native-ios-static-compile-fix-PR33379.patch 
patching file Libraries/Blob/RCTBlobManager.mm
patching file Libraries/Blob/RCTFileReaderModule.mm
patching file Libraries/Blob/React-RCTBlob.podspec
patching file Libraries/Image/RCTImageEditingManager.mm
patching file Libraries/Image/RCTImageLoader.mm
patching file Libraries/Image/RCTImageStoreManager.mm
patching file Libraries/Image/React-RCTImage.podspec
patching file Libraries/LinkingIOS/RCTLinkingManager.mm
patching file Libraries/LinkingIOS/React-RCTLinking.podspec
patching file Libraries/NativeAnimation/RCTNativeAnimatedModule.mm
patching file Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm
patching file Libraries/NativeAnimation/React-RCTAnimation.podspec
patching file Libraries/Network/RCTNetworking.mm
patching file Libraries/Network/React-RCTNetwork.podspec
patching file Libraries/PushNotificationIOS/RCTPushNotificationManager.mm
patching file Libraries/PushNotificationIOS/React-RCTPushNotification.podspec
patching file Libraries/Settings/RCTSettingsManager.mm
patching file Libraries/Settings/React-RCTSettings.podspec
patching file Libraries/Vibration/RCTVibration.mm
patching file Libraries/Vibration/React-RCTVibration.podspec
patching file React/CoreModules/RCTAccessibilityManager.mm
patching file React/CoreModules/RCTActionSheetManager.mm
patching file React/CoreModules/RCTAlertManager.mm
patching file React/CoreModules/RCTAppState.mm
patching file React/CoreModules/RCTAppearance.mm
patching file React/CoreModules/RCTAsyncLocalStorage.mm
patching file React/CoreModules/RCTClipboard.mm
patching file React/CoreModules/RCTDevLoadingView.mm
patching file React/CoreModules/RCTDevMenu.mm
patching file React/CoreModules/RCTDevSettings.mm
patching file React/CoreModules/RCTDevSplitBundleLoader.mm
patching file React/CoreModules/RCTDeviceInfo.mm
patching file React/CoreModules/RCTExceptionsManager.mm
patching file React/CoreModules/RCTI18nManager.mm
patching file React/CoreModules/RCTKeyboardObserver.mm
patching file React/CoreModules/RCTLogBox.mm
patching file React/CoreModules/RCTPlatform.mm
patching file React/CoreModules/RCTRedBox.mm
patching file React/CoreModules/RCTSourceCode.mm
patching file React/CoreModules/RCTStatusBarManager.mm
patching file React/CoreModules/RCTTiming.mm
patching file React/CoreModules/RCTWebSocketModule.mm
patching file React/CoreModules/React-CoreModules.podspec
patching file React/React-RCTFabric.podspec
can't find file to patch at input line 676
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/packages/rn-tester/NativeComponentExample/MyNativeView.podspec b/packages/rn-tester/NativeComponentExample/MyNativeView.podspec
|index 7e0fe5281bac..c7c5b3c87a71 100644
|--- a/packages/rn-tester/NativeComponentExample/MyNativeView.podspec
|+++ b/packages/rn-tester/NativeComponentExample/MyNativeView.podspec
--------------------------
File to patch: 
Skip this patch? [y] y
Skipping patch.
1 out of 1 hunk ignored
patching file scripts/react_native_pods.rb
Hunk #2 succeeded at 343 (offset -6 lines).
Hunk #3 succeeded at 360 (offset -6 lines).
Hunk #4 succeeded at 385 (offset -6 lines).
Hunk #5 succeeded at 466 (offset -6 lines).
Hunk #6 succeeded at 510 (offset -6 lines).
mike@osxvm-little:~/work/Invertase/rnfbdemo/rnfbdemo/node_modules/react-native (rn68) % 

Resulting patch file (for use with patch-package) for anyone else that wants to test is
react-native+0.68.0-rc.2.patch.gz

With the patch integrated, my static frameworks build test now passes!
Reproducible demonstration of compile failure and compile working is present in commit history here https://github.com/mikehardy/rnfbdemo/commits/rn68

Copy link
Contributor

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this change via the patch I attached in comment on the PR, for these scenarios [edit: on an intel mac], they all worked:

  • fabric disabled, hermes/flipper enabled, release mode
  • fabric disabled, hermes/flipper enabled, debug mode
  • fabric disabled, hermes/flipper disabled, static frameworks, debug mode

The matrix of possibilities for compiles is pretty big at this point now that I think about it! But these are my normal cases and represent the normal cases for react-native-firebase users so they are what I test.

All works, and the PR looks reasonable

mikehardy added a commit to mikehardy/rnfbdemo that referenced this pull request Mar 4, 2022
@facebook-github-bot
Copy link
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mikehardy
Copy link
Contributor

Just wanted to add an update that I tested the same set of combinations but on an M1 mac as well (previous comment was an intel mac, sorry I did not specify), and everything worked on it as well, same ✔️ results.
Let me know if there is anything more I can do.

@Kudo
Copy link
Contributor Author

Kudo commented Mar 7, 2022

i am going to rebase main again to fix the conflicts.

@mikehardy
Copy link
Contributor

I suppose this is going to be tricky to apply to 0.68 then, because your previous diff applied against the 0.68 branch - if there were conflicts with main it may require 2 PRs ? (one against main, one against 68 branch?). It definitely worked against 0.68 though, I should be specific and say all my testing was applying diff via patch tools against 0.68.0-rc.2

@Kudo
Copy link
Contributor Author

Kudo commented Mar 7, 2022

the conflict is just one line difference introduced from c2e4ae3. i doubt the pr may break react-native internal BUCK builder because the #import <FBReactNativeSpec/FBReactNativeSpec.h> -> #import <ReactCodegen/FBReactNativeSpec/FBReactNativeSpec.h> change. let's review this on main first. once it landed, we can cherry pick to 0.68-stable.

@@ -7,7 +7,7 @@

#import "RCTSourceCode.h"

#import <FBReactNativeSpec/FBReactNativeSpec.h>
#import <ReactCodegen/FBReactNativeSpec/FBReactNativeSpec.h>
Copy link
Contributor

@cortinico cortinico Mar 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commenting here but this applies to the whole PR.

Sadly, we can't merge this as it is, and we have to find a different approach to this problem. Specifically this is breaking our internal setup (i.e. building React Native iOS with Buck, which sadly we don't use in OSS).

Specifically here we fail internally with:

xplat/js/react-native-github/React/CoreModules/RCTSourceCode.mm:10:9: fatal error: 'ReactCodegen/FBReactNativeSpec/FBReactNativeSpec.h' file not found
#import <ReactCodegen/FBReactNativeSpec/FBReactNativeSpec.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

EDIT: typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, i believed this change would break Buck builder 🤔 could you share more insight for how the Buck targets organized internally? from podspec of view, that's be little weird for FBReactNativeSpec.podspec doesn't have any source_files and React-Codegen puts source_files to FBReactNativeSpec import namespace. is it possible to merge these two?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ideally we can't change those #import <FBReactNativeSpec/FBReactNativeSpec.h> statements as our internal builds rely on them. I'd try to tweak the Podspecs as much as possible to tackle this.

Sadly this is a bigger problem, that is affecting how we do iOS in OSS, and we should look into this problem from a more holistic point of view.

For the sake of 0.68.x, if we could find a patch on the Podspec level, that would be awesome.

cc @cipolleschi @dmitryrykun for visiblity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated the pr to keep #import <FBReactNativeSpec/FBReactNativeSpec.h> imports. please take a look when you get a chance.

this diff is for 0.68.0-rc.2 in case someone need to verify: https://gist.github.com/Kudo/17dde98d7721601697d2dc05ec1dcba1

@Kudo Kudo requested a review from cortinico March 9, 2022 15:18
@facebook-github-bot
Copy link
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Mar 11, 2022
…33409)

Summary:
alternative solution for #33379

> when `use_frameworks!` is on, there are errors like:
> ```
> 'FBReactNativeSpec/FBReactNativeSpec.h' file not found
> #import <FBReactNativeSpec/FBReactNativeSpec.h>
> ```
> this error may come from from f7e4c07c84b6 regression.
>
> when `use_frameworks!` is on, xcode will search headers from framework directories, the correct imports would be `#import <React_Codegen/FBReactNativeSpec/FBReactNativeSpec.h>` (xcode will transform dash to underscore, so it is `React_Codegen` but not `React-Codegen`). in the other hand, when `use_frameworks!` is off, the correct import is `#import <React-Codegen/FBReactNativeSpec/FBReactNativeSpec.h>`.
>
>
> this fix is specific for old architecture (fabric is off).
>
> when fabric is on, there are other errors from duplicated headers when copying to build folder. [the reason is that framework build would try to flatten headers](https://mkonrad.net/2015/03/29/xcode-static-libraries-preserving-header-directory-structure.html). we have `primitives.h` in different folders and they would be flattened into `React_Fabric.framework/Headers`. to be honest, i don't know how to deal with the problem in the meantime,  maybe subspecs are not enough, we should separate them from subspecs to dedicated podspecs so that we can have these targets as different frameworks.

in this alternative fix, i try to add `React-Codegen/React_Codegen.framework/Headers` into header search paths and make original `#import <FBReactNativeSpec/FBReactNativeSpec.h>` reachable.

[this change](7a0398c) in the pr is just a workaround to solve breaking in latest main branch and this is not important to the `use_frameworks!` fix at all. this breaking was coming from 1804951.

## Changelog

[iOS] [Fixed] - Fix iOS build error when Podfile `use_frameworks!` is on and Fabric is off

Pull Request resolved: #33409

Test Plan:
verify with rn-tester
1. change `fabric_enabled` to false in `packages/rn-tester/Podfile`
2. `USE_FRAMEWORKS=1 pod install`
3. build rn-tester in xcode

Reviewed By: dmitryrykun

Differential Revision: D34817041

Pulled By: cortinico

fbshipit-source-id: 4d1a610e99a807793eb3f64461e0d735c0a9ca9c
@cortinico
Copy link
Contributor

Closing as

@cortinico cortinico closed this Mar 11, 2022
@Kudo Kudo deleted the fix-pod-errors branch March 11, 2022 18:37
ShikaSD pushed a commit that referenced this pull request Mar 16, 2022
…33409)

Summary:
alternative solution for #33379

> when `use_frameworks!` is on, there are errors like:
> ```
> 'FBReactNativeSpec/FBReactNativeSpec.h' file not found
> #import <FBReactNativeSpec/FBReactNativeSpec.h>
> ```
> this error may come from from f7e4c07c84b6 regression.
>
> when `use_frameworks!` is on, xcode will search headers from framework directories, the correct imports would be `#import <React_Codegen/FBReactNativeSpec/FBReactNativeSpec.h>` (xcode will transform dash to underscore, so it is `React_Codegen` but not `React-Codegen`). in the other hand, when `use_frameworks!` is off, the correct import is `#import <React-Codegen/FBReactNativeSpec/FBReactNativeSpec.h>`.
>
>
> this fix is specific for old architecture (fabric is off).
>
> when fabric is on, there are other errors from duplicated headers when copying to build folder. [the reason is that framework build would try to flatten headers](https://mkonrad.net/2015/03/29/xcode-static-libraries-preserving-header-directory-structure.html). we have `primitives.h` in different folders and they would be flattened into `React_Fabric.framework/Headers`. to be honest, i don't know how to deal with the problem in the meantime,  maybe subspecs are not enough, we should separate them from subspecs to dedicated podspecs so that we can have these targets as different frameworks.

in this alternative fix, i try to add `React-Codegen/React_Codegen.framework/Headers` into header search paths and make original `#import <FBReactNativeSpec/FBReactNativeSpec.h>` reachable.

[this change](7a0398c) in the pr is just a workaround to solve breaking in latest main branch and this is not important to the `use_frameworks!` fix at all. this breaking was coming from 1804951.

[iOS] [Fixed] - Fix iOS build error when Podfile `use_frameworks!` is on and Fabric is off

Pull Request resolved: #33409

Test Plan:
verify with rn-tester
1. change `fabric_enabled` to false in `packages/rn-tester/Podfile`
2. `USE_FRAMEWORKS=1 pod install`
3. build rn-tester in xcode

Reviewed By: dmitryrykun

Differential Revision: D34817041

Pulled By: cortinico

fbshipit-source-id: 4d1a610e99a807793eb3f64461e0d735c0a9ca9c
Saadnajmi pushed a commit to Saadnajmi/react-native-macos that referenced this pull request Jan 15, 2023
…acebook#33409)

Summary:
alternative solution for facebook#33379

> when `use_frameworks!` is on, there are errors like:
> ```
> 'FBReactNativeSpec/FBReactNativeSpec.h' file not found
> #import <FBReactNativeSpec/FBReactNativeSpec.h>
> ```
> this error may come from from facebook@f7e4c07c84b6 regression.
>
> when `use_frameworks!` is on, xcode will search headers from framework directories, the correct imports would be `#import <React_Codegen/FBReactNativeSpec/FBReactNativeSpec.h>` (xcode will transform dash to underscore, so it is `React_Codegen` but not `React-Codegen`). in the other hand, when `use_frameworks!` is off, the correct import is `#import <React-Codegen/FBReactNativeSpec/FBReactNativeSpec.h>`.
>
>
> this fix is specific for old architecture (fabric is off).
>
> when fabric is on, there are other errors from duplicated headers when copying to build folder. [the reason is that framework build would try to flatten headers](https://mkonrad.net/2015/03/29/xcode-static-libraries-preserving-header-directory-structure.html). we have `primitives.h` in different folders and they would be flattened into `React_Fabric.framework/Headers`. to be honest, i don't know how to deal with the problem in the meantime,  maybe subspecs are not enough, we should separate them from subspecs to dedicated podspecs so that we can have these targets as different frameworks.

in this alternative fix, i try to add `React-Codegen/React_Codegen.framework/Headers` into header search paths and make original `#import <FBReactNativeSpec/FBReactNativeSpec.h>` reachable.

[this change](facebook@7a0398c) in the pr is just a workaround to solve breaking in latest main branch and this is not important to the `use_frameworks!` fix at all. this breaking was coming from facebook@1804951.

## Changelog

[iOS] [Fixed] - Fix iOS build error when Podfile `use_frameworks!` is on and Fabric is off

Pull Request resolved: facebook#33409

Test Plan:
verify with rn-tester
1. change `fabric_enabled` to false in `packages/rn-tester/Podfile`
2. `USE_FRAMEWORKS=1 pod install`
3. build rn-tester in xcode

Reviewed By: dmitryrykun

Differential Revision: D34817041

Pulled By: cortinico

fbshipit-source-id: 4d1a610e99a807793eb3f64461e0d735c0a9ca9c
@cglacet
Copy link

cglacet commented Feb 8, 2023

Hello, I'm having the error you described here (react-native 0.70.6), the path problem seems to arise in multiple locations for me:

▸ Compiling RCTVibration.mm

❌  /Users/cglacet/Kune/Clients/client/node_modules/react-native/Libraries/Vibration/RCTVibration.mm:11:9: 'FBReactNativeSpec/FBReactNativeSpec.h' file not found

#import <FBReactNativeSpec/FBReactNativeSpec.h>
                                        
▸ Compiling RCTNetworking.mm

❌  /Users/cglacet/Kune/Clients/client/node_modules/react-native/Libraries/Network/RCTNetworking.mm:11:9: 'FBReactNativeSpec/FBReactNativeSpec.h' file not found

#import <FBReactNativeSpec/FBReactNativeSpec.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▸ Compiling RCTSettingsManager.mm

❌  /Users/cglacet/Kune/Clients/client/node_modules/react-native/Libraries/Settings/RCTSettingsManager.mm:10:9: 'FBReactNativeSpec/FBReactNativeSpec.h' file not found

#import <FBReactNativeSpec/FBReactNativeSpec.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▸ Compiling RCTNativeAnimatedTurboModule.mm

❌  /Users/cglacet/Kune/Clients/client/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm:8:9: 'FBReactNativeSpec/FBReactNativeSpec.h' file not found

#import <FBReactNativeSpec/FBReactNativeSpec.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

▸ Compiling RCTNativeAnimatedModule.mm

❌  /Users/cglacet/Kune/Clients/client/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:8:9: 'FBReactNativeSpec/FBReactNativeSpec.h' file not found

#import <FBReactNativeSpec/FBReactNativeSpec.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I searched for this file and it only appears in several ./ios/Build subdirectories, for example this one:

./ios/Build/generated/ios/FBReactNativeSpec/FBReactNativeSpec.h

I thought maybe I should remove the build directory just in case, but it didn't work either and I still can't compile RCTNativeAnimatedModule, RCTNativeAnimatedTurboModule and RCTSettingsManager. I've also tried removing node_modules, Pods and both yarn.lock and Podfile.lock without success:

❯ rm -rf yarn.lock node_modules ios/Pods ios/Podfile.lock ios/Build &&
yarn install && cd ios && pod install && .. && yarn ios:build

But it didn't solve the issue.

Here is my Podfile content:

# Manual merge from : https://raw.githubusercontent.com/react-native-community/rn-diff-purge/release/0.67.2/RnDiffApp/ios/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.4'
install! 'cocoapods', :deterministic_uuids => false

$RNFirebaseAsStaticFramework = true
$RNMapboxMapsImpl = 'mapbox'

project 'Kune', 
  'Release' => :release, 
  'Staging.Release' => :release, 
  'Development.Release' => :release, 
  'Debug' => :debug,
  'Staging.Debug' => :debug,
  'Development.Debug' => :debug


use_frameworks! :linkage => :static

target 'Kune' do
  config = use_native_modules!(packages_to_skip: ['react-native-flipper'])
  pod 'react-native-config', :path => '../node_modules/react-native-config'
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => true,
    :fabric_enabled => flags[:fabric_enabled],
    :flipper_configuration => FlipperConfiguration.disabled,
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'KuneTests' do
    inherit! :complete
  end

  pre_install do |installer|
    $RNMBGL.pre_install(installer)
  end

  post_install do |installer|
    react_native_post_install(
      installer,
      :mac_catalyst_enabled => false
    )
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      end
    end
    # Ref: https://stackoverflow.com/a/63955114/1720199
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
    $RNMBGL.post_install(installer)
  end

  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'Firebase/Analytics'
  pod 'Firebase/Auth'
  pod 'GoogleSignIn'
end

I couldn't find any help about this, sorry for asking this here, but you seem to understand the issue so I guessed maybe there is something obvious I missed.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Needs: React Native Team Attention p: Expo Partner: Expo Partner Platform: iOS iOS applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants