react-native: Build on IOS failed
Description
I’m trying to build my app on Mac for iOS, when I try to build the app he gives me an error
The following build commands failed: CompileC /Users/gbdev/Library/Developer/Xcode/DerivedData/GBWebApp-dgxghrfnprondmbkxeptlzyzcmeu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-logger.build/Objects-normal/arm64/react_native_log.o /Users/gbdev/Desktop/ProgettiCA/rn-GBAppWeb/node_modules/react-native/ReactCommon/logger/react_native_log.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-logger' from project 'Pods') (1 failure)
I have tried to clean cache and everything I can do and find on internet, but nothing of these works.
Version
0.69.3
Output of npx react-native info
System: OS: macOS 12.6 CPU: (8) arm64 Apple M1 Memory: 129.89 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.9.0 - /opt/homebrew/bin/node Yarn: Not Found npm: 8.19.1 - /opt/homebrew/bin/npm Watchman: 2022.09.19.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 14.0/14A309 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: ^0.69.3 => 0.69.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
npm run iOS to run iOS app, on building phase he stops and gave me the error I wrote before.
Snack, code example, screenshot, or link to a repository
I don’t have any code to show, it’s not a my code problem
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 28 (7 by maintainers)
@cipolleschi I’ve resolved it:
According to Firebase docs:
What I did:
cd ios
and added to the top in Podfile:use_frameworks! :linkage => :static
:flipper_configuration => FlipperConfiguration.enabled
pod install --repo-update
And it is working for me 😉
Hi there, the same issue for me.
I faced same problem. It appeared after installing Firebase SDK and running
pod install
(faced error message that I need to useuse_modular_headers!
in Podfile).After that I can’t build app.
0.71.1 same issue
//fix which works for me: in AppDelegate.mm i’ve changed #import “ReactNativeConfig.h” into #import “RNCConfig.h”
Could you try the following commands, from your app root:
cd ios
rm -rf Pods Podfile.lock <your_app_name>.xcworkspace build
bundle install
(if you haven’t already run this)bundle exec pod install
cd ..
npx react-native run-ios
The first 2 commands will clean up the dependencies for the iOS project The second 2 will reainstall them (notice that bundle will require you to use Ruby 2.7.5, so you may have to install a ruby version manager and update Ruby… You can read more here) The last two will try to build your app again.
So… as far as I can see, you are using a Cocoapods plugin that allow you to mix Static Frameworks and static libraries.
This is not required anymore. To simplify the setup, please remove the lines:
Now, there is the
react-native-video
framework that is causing problems. Let’s try to add the following line:I’m not 100% confident that it will work, but it should.
Also, if you can prepare a small repro (new app with just the dependencies that creates this problem) I can investigate better.
Thank you so much.
Any solution for this? I’ve done everything, still nothing. I am getting exact same issue for some packages such as like react-native-nfc-manager,react-native-video.ie (in target ‘react-native-nfc-manager’ from project ‘Pods’),(in target ‘react-native-video’ from project ‘Pods’) for almost every packages in my project. I have tried a lot of things such as reinstalling pod file, deleting derived data, updating Xcode. Still no change. Any help?
npx react-native info
System: OS: macOS 13.2.1 CPU: (8) arm64 Apple M1 Memory: 68.19 MB / 8.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 19.6.0 - /opt/homebrew/bin/node Yarn: Not Found npm: 9.4.1 - /opt/homebrew/bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.3 - /Users/donamstechlabs/.rbenv/shims/pod SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 Android SDK: Not Found IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 14.3/14E222b - /usr/bin/xcodebuild Languages: Java: 17.0.6 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.8 => 0.70.8 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Thanks for your support but it turns out to be an error caused RNFirebase. I found out by opening the project.xcworkspace on Xcode and going through what seems to be failing my build. I noticed that the RNFirebase was failing my build so I tried uninstalling it and it worked. My project was up and running again. Anyway, thank you guys for the help and support ❤️
@cipolleschi Created a repo: https://github.com/olegtech/pod-issue-repo/tree/main/TestRepo
First of all I’m using version of RN:
0.70.1
What I did:
npx react-native init TestRepo
cd ./TestRepo/ios && pod install
bundle install
pod install
yarn add @react-native-firebase/app
pod install
(got an error about use_modular_headers! in Podfile)yarn ios
(asnpx react-native run-ios
)