React Native - yarn ios doesn't work after initializing the project - ios

I'm a new user to Mac OS and its system and M1.
After install dependencies of my project and trying yarn iOS
* BUILD FAILED **
The following build commands failed:
CompileC /Users/Library/Developer/Xcode/DerivedData/cemfgnbnzwyxlydpmalbfirprbcu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/arm64/RNSScreenViewEvent.o /Users/Trampo/node_modules/react-native-screens/ios/RNSScreenViewEvent.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNScreens' from project 'Pods')
(1 failure)

For React Native you also have to maintain the ios pod files. So, go to your ios folder and update your pods.
Terminal command:
cd ios/ && pod install --repo-update

I change React Native version to 0.64.4,
run yarn,
cd iOS
pod install
pod update,
Xcode and terminal (iterm2) to running with rosetta.
Work, thanks.

Related

React native whne i type : yarn ios ExpoModulesCore/ExpoModulesCore.modulemap' not found

I am using mac Big Sur version 11.6 and i am stuck on this problem
Debug-iphoneos/ExpoModulesCore/ExpoModulesCore.modulemap' not found
Failed to build iOS project. "xcodebuild" exited with error code 65.
it is possible that pod install failed.
Copy the contents of your Podfile somewhere safe
Run: pod cache clean --all
Remove "Podfile"-file from the dir.
Xcode: Product > Clean Build Folder
Run: pod init. A new "Podfile"-file is added to the dir
Start adding parts of your original Podfile to this file
Run: pod install
Try to build your project again

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'Pageboy' from project 'Pods')

I am getting the below error when I build my iOS project in Xcode 13.0 for Simulator 15 with Swift 5.5
Issue related to your's dependencies: You must have to wait for those dependencies to update to Swift 5.5, otherwise, you have to stay on Xcode 12. In my case, I updated to 13 during development.
For Example:
The following build commands failed:
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'ExpoModulesCore' from project 'Pods')
The outdated pod here seems to be ExpoModulesCore
and if it does not work, like it did not for me lol:
follow this: https://stackoverflow.com/a/69384358/15421728
For anyone looking for an answer.
run
cd ios
pod update ExpoModulesCore
and repeat the previous step for every outdated pod, if there are more outdated.
I am working with react native and had a very similar error.
This worked for me:
cd ios && rm -rf Pods && pod cache clean --all && pod install && cd ..
For me it helped to downgrade XCode. I got back from 13.3 to 13.2.
You can get previous versions this way:
https://stackoverflow.com/a/7047804/7405518
Getting back to version 13.3 caused same problems again.
I got this as well, but I just had to add my package again yarn add ... so it autolinked correctly with react-native

Error in Xcode 12.5.1 while building, (error spawnSync xcodebuild ENOBUFS)

I was running react-native project in Xcode v12.4, now I shifted my code to v12.5.1. It is giving me above error, when I build my project. What should I do?
I have googled around but not found this error regarding iOS and Xcode.
If you don't have cocoa pods installed you need to by command sudo gem install cocoapods and run following commands from your project main directory
From your project remove Pods and Podfile.lock from ios directory after that re install pods
cd ios && pod install && cd ..
Run your project again

react-native build failing with error code 65 and ___darwin_check_fd_set_overflow

I am trying to build a React Native app. I have already worked with other react native projects previously and haven't faced any issues. This time, I am not able to run the app.
I created a new react-native project with:
npx react-native init demoproject
and ran it with:
cd demoproject
npx react-native start
npx react-native run-ios
In the terminal, I got this error:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening demoproject.xcworkspace. Run CLI with --verbose flag for more details.
When I tried running it with Xcode, I got this error:
Undefined symbols for architecture x86_64:
"___darwin_check_fd_set_overflow", referenced from:
_RAND_poll in libcrypto.a(rand_unix.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I tried these steps without any success.
react-native start --reset-cache
rm -rf node_modules/
rm -rf package-lock.json
cd ios
pod deintegrate
cd ..
rm -rf ios/Podfile.lock
npm install
npm audit fix
react-native link
cd ios
pod install
cd ..
react-native run-ios
Environments:
Xcode: 11.2 (11B52)
OS: mac OS Catalina 10.15.1
react-native-cli: 2.0.1
react-native: 0.62.2
I have a few other react-native projects that I tried and they run successfully. They also run on the same react-native version(0.62.2)
Is there anyway to solve the issue? Will updating Xcode to another version like 11.4 or 11.6 solve the problem?
You have to remove Flipper Pod from file goto
Your Project Folder->ios->Podfile and comment Flipper from that file as below
#use_flipper!
#post_install do |installer|
#flipper_post_install(installer)
#end
Now from ios folder enter below command in terminal
pod install
It will fix this issue.
A temporarily workaround:
Comment all flipper functions in podfile;
Remove flipperInit in appDelegate.m;
Run pod install inside ios folder;
Clean project;
Run project again.
I solved this issue with
1.Comment all the below mentioned 4 flipper function lines in Podfile
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
2.run pod install
3.run the project.
This resolved my issue.

firebase_ml_vision breaks IOS build, fix for Windows machine

I have a windows machine and would like to build my flutter app for my Iphone. I am using codemagic.com to build my app. With the firebase_ml_vision dependency there is an error when building the app for iOS as seen here, https://github.com/flutter/flutter/issues/28625. I am not sure how to fix this on my windows machine because i am unable to access the iOS build files.
Here is the error message when building the app for iOS
Returning local
[!] CocoaPods could not find compatible versions for pod "firebase_ml_vision":
In Podfile:
firebase_ml_vision (from .symlinks/plugins/firebase_ml_vision/ios)
Specs satisfying the `firebase_ml_vision (from `.symlinks/plugins/firebase_ml_vision/ios`)` dependency were found, but they required a higher minimum deployment target.
If you are using firebase_ml_vision: ^0.10.0 or up, you have to change your Deployment target to 10.0:
In your Podfile: platform :ios, '10.0'
In your Xcode project set iOS Deployment Target to 10.0
Then, run the following in your terminal to build with a fresh state:
flutter clean \
&& rm ios/Podfile.lock pubspec.lock \
&& rm -rf ios/Pods ios/Runner.xcworkspace \
&& flutter build iOS

Resources