XCode Build Phase script exit code 1 error React Native - ios

I am working on a React-Native application. I've inherited it, development has been stopped for a while and some of the dependencies are outdated. I do not believe this is part of the problem but worth mentioning. Whatever I do, both on the command line and in XCode, the build fails with the following error:
/bin/sh -c /Users/ME/Library/Developer/Xcode/DerivedData/AppName-cftpundgcnfgkvchyeqvsgfusuhb/Build/Intermediates.noindex/AppName.build/Debug-iphonesimulator/AppName.build/Script-948B6EB41D047ADB00584768.sh
Error loading build config, ignoring
Command /bin/sh failed with exit code 1
What I've done
npm install
In the ios directory, "sudo gem install cocoapods" and "pod install"
react-native run-ios
One way or another, this never works and the error is always the one above
What I've tried
Locking and unlocking the keychain
Deleting the derived data folder, cleaning and re-building
Ticking the "only run for install" checkbox in XCode in the RN bundle section
Using yarn instead of npm
pod deintegrate and install once again
Upgrading react-native
Once more, no luck
I'm fairly new to this and don't fully understand what's going on - or why this is failing. Any ideas as to how to solve it?
Version info
react-native-cli: 2.0.1
react-native: 0.61.5
xcode: Version 12.3 (12C33)
simulator: iphone 11 (ios 14.3)

Related

Xcode 13.4.1 error: unable to attach DB: error: accessing build database (react native)

**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 app.xcworkspace.
**error**: unable to attach DB: error: accessing build database "/Users/user/Library/Developer/Xcode/DerivedData/app-cdawdoxdzwfdgueqnyshuhonxndw/Build/Intermediates.noindex/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.
tried almost everything
build cleans, reinstalling pods etc
react native version: 0.67.3
Xcode version: 13.4.1
After almost one day of debugging this issue, came to know about this article which solves the problem for me, although article has more than one steps but I just tried the last one and it worked, mentioning the steps below,
rm -rf ~/Library/Developer/Xcode/DerivedData/
cd ios
pod deintegrate
pod update
cd..
yarn run ios or npm run ios

Why can't I compile my React-native apps anymore?

I'm gonna ask your guidance/help for a problem I've been encountering for several days now,
I can create a new react native project (via npx react-native init projectName), but when I try to run it, either with npx react-native run-ios or yarn ios, I get the following error message:
The following build commands failed: CompileC
/Users/user/Library/Developer/Xcode/DerivedData/Trickster-ejsutjhruuvmqjedsaarumhaquan/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/SysUio.o
/Users/user/Dev/Mobile/React
Native/Trickster/ios/Pods/RCT-Folly/folly/portability/SysUio.cpp
normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in
target 'RCT-Folly' from project 'Pods')
I've already cleaned yarn/npm cache, cleaned Xcode's DerivedData folder, even uninstalled node and react native from my computer, so I'm kinda lost tbh.
Here are my specs:
MacBook Pro Mid 2014 with a 2.6GHz Core i5, 8Gbs of ram running macOS Monterey 12.2.1
npm version 8.5.2, 1.22.17 and Xcode 13.2.1.
Sorry in advance if I don't answer fast, I'm a bit ill atm so kinda occupying my time till I'm better
Try running Project from Xcode that will show you where problem exactly is
This problem can be for several reasons. To avoid going into so much explanation If the application worked at some point
Delete the app in the device and
run yarn android or npm android
or
delete the build folder and delete the app in the device and
run yarn android or npm android or
on Android delete and reinstall the device then
run yarn android or npm android
That's works for me

failure to install cocoapods when initializing a react-native project

I'm currently running macOS Catalina 10.15.6 and XCode 12.4. I'm trying to create a react native ios app and I'm on the command line running "react-native init Focus" where Focus is the name of my app.
When setting up the app, I get the error "(node:11768) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template"
I try to run "cd ./Focus/ios && pod install" which fails, and I have also tried "sudo gem install cocoapods" and "brew install cocoapods" which all fail.
I cannot get past this setup phase of the project.
Fire below code for the setup Project.
npx react-native init ( Your Project Name)
Above code set up your project. And then open your project in IDE which you use for business coding and follow these steps.
Start your react native server by hit the following code
npx react-native start
For the run in iOS do the following steps
cd ios
pod install
cd ..
npx react-native run-ios
Or also you can directly run from Xcode after the third step. You do not need to hit the 4 setup

Lexical or processor issue: boost/config/user.hpp' file not found

When i run my react native app in Xcode, it shows an error "boost/config/user.hpp' file not found" . And also when i run the application using the command "react-native run-ios" ,I got an error in terminal ,
"Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/sample2.app/Info.plist" Print: Entry, ":CFBundleIdentifier", Does Not Exist " .
How can i solve this. I am a bigginer in react native app development.
It's related to this boost package: ./node_modules/react-native/third-party/boost_1_63_0/boost/config
Remove third-party folder from path: /node_modules/react-native/third-party/
Re-run the Xcode project.
Do you have any updates to run on your machine/xcode? I had this issue when I had pending macOS Sierra updates to install.
I installed the updates which caused my mac to restart, I then ran npm install and tried to build again and it succeeded.
Versions:
macOS Sierra: 10.12.6
Xcode: 8.3.3
react: 16.0.0-alpha.12
react-native: 0.47.1
Some packages are not installed properly. Just delete node-modules forder with rm -rf node-modules and run again (npm install or yarn install).

Ionic Build iOS - Fail

I've been workign on this project for months now with no major issues. Today I can't even get it to build out. I ran "$ionic resources" and now I can't get my build to work at all.
I'm getting this error:
** BUILD FAILED **
The following build commands failed:
CompileAssetCatalog build/emulator/Stopper.app Stopper/Images.xcassets
(1 failure)
ERROR building one of the platforms: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/cordova/build-debug.xcconfig,-project,Stopper.xcodeproj,ARCHS=i386,-target,Stopper,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/build/sharedpch
You may not have the required environment or OS to build this project
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/cordova/build-debug.xcconfig,-project,Stopper.xcodeproj,ARCHS=i386,-target,Stopper,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/colemanjeff/GitHub/StopperRC1/platforms/ios/build/sharedpch
I'm not sure what caused the problem or how to fix it. Anyone have any idea?
Turns out I actually did need to uninstall the platform, remove the plugin json file, and then reinstall everything.
Run (this will remove the old ionic ios platform)
sudo ionic platform rm ios
Then (this will install a new platform with privileges)
sudo ionic platform add ios
Then build your code ios/android
ionic build ios
ionic build android
This fixed it for me!
Might be that you should also run
sudo ionic resources
to generate new icon and splash screens.
Basically, re-installation of Platform and Plugins once again resolves the issue.

Resources