Related
I am using a MacBook Pro with
M1 chip
MacOS Big Sur
Xcode Version 13.2.1
node v14.17.5
I wanted to follow this tutorial to set up a new React Native project called AwesomeProject https://reactnative.dev/docs/environment-setup the section with React Native CLI Quickstart.
When I try to run the app in terminal by typing: npx react-native run-ios
my build fails with the following error:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/thomashuber/Library/Developer/Xcode/DerivedData/AwesomeProject-aprperxvqrezbfeyvousbagyesvr/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-5F4C70EF7D90A5A5BDAEB404279F232A.sh (in target 'FBReactNativeSpec' from project 'Pods')
(1 failure)
When I try to run it in Xcode either on a simulator or on an iPhone device I get the following error in FBReactNativeSpec:
/bin/sh -c /Users/thomashuber/Library/Developer/Xcode/DerivedData/AwesomeProject-aprperxvqrezbfeyvousbagyesvr/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-5F4C70EF7D90A5A5BDAEB404279F232A.sh
Command PhaseScriptExecution failed with a nonzero exit code
I restarted my MacBook, I deleted the project and tried it again. I cleaned the project in Xcode but none of it helps. I suspect that it is due the M1 chip of my MacBook.
For me anyone of this solutions work because, with Xcode 14.2 and RN0.70.5, there is the following 2 files in ios folder which fixe node version with the path (I don't know since which version and which one adds this files) :
.xcode.env
.xcode.env.local
If you are this files inside ios folder just do this (with or without nvm) :
which node
And put the patch inside the .xcode.env.local like this :
export NODE_BINARY="/Users/Blabla/.nvm/versions/node/v16.14.0/bin/node"
If this files doesn't exist, try to add it and maybe Xcode will take it into account :
Inside ios/.xcode.env
# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)
Inside ios/.xcode.env.local
export NODE_BINARY="/Users/Blabla/.nvm/versions/node/v16.14.0/bin/node"
If you shut down your computer or did a recent upgrade to node or nvm something in the cache folder gets reset and the build fails. The code in the react native node_modules/react-native/scripts/find-node.sh script related to nvm. Following this advice: https://stackoverflow.com/a/70104375/5927929 worked for me with a small change.
My specs:
Mac intel chip
RN 0.68.2
nvm (0.33.11) && node (v18.3.0) install
Steps:
nvm unalias default
nvm alias default node
Build in xcode...done
I managed to get rid of the FBReactNativeSpec error by editing the Project settings.
Try the following:
In Xcode select your app's project and then select the target.
In Terminal enter the following command to find out the path of your node installation:
which node
This should give you a path. Something like:
/Users/thomashuber/.nvm/versions/node/v16.14.0/bin/node
Copy this path.
In Xcode with the target selected click on Build Phases and open Bundle React Native code and images
Replace NODE_BINARY=node. Instead of node enter the path that you have copied so that it is something like this NODE_BINARY=/Users/thomashuber/.nvm/versions/node/v16.14.0/bin/node
Simply delete the FBReactNativeSpec file from the Pods as shown in the image below.enter image description here
In my case this error raising due to node path is not set in PATH Variables.
Try to run below command it will set missing node path in PATH variable and it resolve the error.
sudo ln -s $(which node) /usr/local/bin/node
https://reactnative.dev/docs/new-architecture-troubleshooting#:~:text=Command%20PhaseScriptExecution%20failed%20with%20a,libraries%20(FBReactNativeSpec%2C%20rncore).
Ok, worth trying this.
2 different solutions :
1: As soon as we get this error message:
Always scroll up & read the issue if written in that log file. Any issues like syntax error or issue related to your js code (like multiple imports in your js files or if you had forgot to import something).
If yes, you can fix that first & re build it.
In my case I had multiple imports of one of the RN components.
if not
2: got to 'Keychain access' in your mac, lock & unlock login and re build it, this may help you.
And make sure to
'cd ios' && 'pod install'
if you have forgot to do it after installing any of the npm package.
In case someone else tried everything mentioned here and in other threads, and it didn't work, here is what worked for me!
I uninstalled my nvm install
installed node globally (https://nodejs.org/en/download/)
ran pod install and got this error message:
[!] CocoaPods could not find compatible versions for pod "hermes-engine":
In snapshot (Podfile.lock):
hermes-engine (from ../node_modules/react-native/sdks/hermes/hermes-engine.podspec)
In Podfile:
hermes-engine (from ../node_modules/react-native/sdks/hermes/hermes-engine.podspec)
It seems like you've changed the version of the dependency hermes-engine and it differs from the version stored in Pods/Local Podspecs.
You should run pod update hermes-engine --no-repo-update to apply changes made locally.
But instead of running the command they gave me, I deleted Podfile.lock and the Pods directory, then reran pod install, and the build finally worked!
Determine what your node binary is:
$ which node
/opt/homebrew/bin/node
Add a fixer function in your Podfile:
def fix_fb_react_native_spec(installer)
installer.pods_project.targets.each do |target|
if target.name == 'FBReactNativeSpec'
target.build_configurations.each do |config|
if config.name == 'Debug' or config.name == 'Release'
config.build_settings['NODE_BINARY'] = '/opt/homebrew/bin/node'
end
end
end
end
end
In your postinstall, add fix_fb_react_native_spec(installer) like so:
post_install do |installer|
react_native_post_install(installer)
fix_fb_react_native_spec(installer)
end
Pod install
Rebuild (ideally with a clean build)
In my case:
M1 chip
MacOS Monterey
Xcode Version 13.2.1
node v16.6.0
react-native 0.69
I was trying to build the iOS app via terminal under Rossetta. Once I tried to use native M1 terminal - it worked well.
Go to your applications, right click on the app, get info, check OFF Open using Rossetta
I'm getting the following error when building my project: Command PhaseScriptExecution failed with a nonzero exit code.
This is what I have in my [CP] Embed Pods Frameworks:
I've also done a pod deintegrate and pod install but these frameworks continue to show in red:
I'm on Xcode Version 12.4 and my mac has an Apple M1 chip. Any thoughts as to what I could do to resolve this error?
Clearing the Excluded Architectures solved the issue. I originally had arm64 and x86_64 excluded.
Did you solve your issue?
I got the one of solutions.
First of all, you have to delete the files which are red of iOS, Frameworks . They don't exist anymore, so you shouldn't include them to archive.
then clean up your builds.
(click Xcode -> product -> clean build folder)
go to archive.
(click Xcode -> product -> archive)
If you don't use M1, then you have to exclude architectures "arm64".
That's it.
Hope it works.
clear all files inside Library/Developer/Xcode/DerivedData/
List item clean & build again from xcode
if you're using nvm make sure you don't have another globally installed version of Node/npm.
If you aren't sure whether or not you have a global version, go to your bash_profile/zshrc and comment the three nvm initialization lines (export NVM_DIR="$HOME/.nvm" [...]), then open a new terminal and do node --version, if it still finds something it means that you have a global version somewhere, and you can find its path with which node.
In my case I'm using Homebrew, and I had a global version of Node that I wasn't even aware coming from the yarn formula, I discovered it after running brew uses --installed node. I went ahead and uninstalled yarn using brew uninstall --force yarn, which automatically uninstalled its node/npm dependency, then uncommented the nvm initialization lines, and then I reinstalled yarn using nvm's npm with npm i -g yarn, and now everything works.
Another way, after installing node via brew install node RUN sudo ln -s /opt/homebrew/bin/node /usr/local/bin/node
restart xcode and try to build again.
Showing Recent Messages:-1: mkdir -p /Users/spritzindia/Library/Developer/Xcode/DerivedData/Contigo-atftiouzrdopcmcpprphpilawwzm/Build/Products/Debug-iphonesimulator/Contigo.app/Frameworks
Showing Recent Messages:-1: rsync --delete -av --filter P .*.?????? --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "/Users/pothi/Library/Developer/Xcode/DerivedData/Contigo-atftiouzrdopcmcpprphpilawwzm/Build/Products/Debug-iphonesimulator/IQKeyboardManagerSwift/IQKeyboardManagerSwift.framework" "/Users/pothi/Library/Developer/Xcode/DerivedData/Contigo-atftiouzrdopcmcpprphpilawwzm/Build/Products/Debug-iphonesimulator/Contigo.app/Frameworks"
Command PhaseScriptExecution failed with a nonzero exit code
I deleted derived data.
i have tried :
keychain access -> right click on login -> lock & unlock again ->
clear Xcode project
Restarted machine, no use
How do I resolve "Command PhaseScriptExecution failed with a nonzero exit code" error when trying to archive project.
And I am using those librarys
pod 'IQKeyboardManagerSwift'
pod 'SDWebImage', '~> 4.0'
pod 'KRPullLoader'
pod 'Paytm-Payments'
After trying all the solutions, I was missing is to enable this option in:
Targets -> Build Phases -> Embedded pods frameworks
In newer versions it may be listed as:
Targets -> Build Phases -> Bundle React Native code and images
Run script only when installing
Go to
Keychain Access -> Right-click on login -> Lock & unlock again
Xcode -> Clean Xcode project ->Make build again
Run the following commands from the ios directory:
pod deintegrate
pod install
XCode Clean build
Or, One-Liner:
pod deintegrate; pod install
Warning: Legacy Build System is deprecated and will be removed in a further release.
Xcode -> File -> Workspace Setting -> change Build System to Legacy Build System.
Note - Its not the ideal solution.
For me, I was removing Crashlytics, Fabric and FirebaseCrashlytics. So there was a script (Run Script) for Fabric. So since app was running that first and I had removed the framework already, I was getting this error. So I removed the Run Script tab for Fabrics and then it worked perfectly fine.
I have faced the same issue in Xcode 13. I have updated the Crashlytics SDK after that I got the same issue.
In my case I have followed the Solution2
Solution1:
I have removed the data from Run Script.
-> Targets ->go to Build Settings ->Click Run Script -> Remove script data
Solution2:
If script is mandatory to your project just select install builds only option.
Select For install builds only option
Script:
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/#####/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
In the above script ##### is the app name, if required replace with your app name. If not, use below script.
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Solution 3
And one more importent thing is you must set the path of the file properly.
Find the below example path.
You have multiple google services plist piles, in this case you are
maintaining 2 different files.
Your google service info plist file was under FireBase, Dev. In this case you must add these files path properly. Otherwise you will get the same error.
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/#####/Firebase/Dev/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
Solution 3 file structure:
Xcode 12.2 solution:
Go to:
Build settings -> Excluded Architectures
Delete "arm64"
I was facing this issue because of Firebase Crashlytics. In
Targets -> Build Phases -> Run Script
I had Firebase Crashlytics written like
${PODS_ROOT}/FirebaseCrashlytics/run
I changed that and put it in double quotes
"${PODS_ROOT}/FirebaseCrashlytics/run"
For me, the issue was with the node version that xcode was using. My project was building fine in Expo but not in Xcode after ejecting. I found my answer here: https://github.com/expo/expo/issues/8488
check you have the latest version of node
$ node --version
delete the version in /usr/local/bin/
$ rm /usr/local/bin/node
re add a sym link
$ ln -s $(which node) /usr/local/bin/node
Restart worked for me... Mac OS restart, not xCode restart...
The reason
This build phase also lets you provide a list of input and output files. The script always runs when no input and output files are provided. When input and output files are provided, the script only runs if it has never been run before, one of the input files has changed, or one of the output files is missing
If you are using cocoapods, you may not be required to have an additional run script .
The solution
So the solution is remove the script as follows:
I had a similar error
/{path to project root}/Pods/Target Support Files/Pods-{project name}/Pods-{project name}-frameworks.sh: Permission denied
Command PhaseScriptExecution failed with a nonzero exit code
In my case I had received a zip of a repo that included the Pods folder. It turns out that at some point between it being originally created and sent to me, the *.sh files in Pods/Target Support Files/Pods-{PROJECT}/ had all lost their execute permissions. Giving those files +x was the solution
For Example:
chmod +x (File name in the error)
In my case: chmod +x Pods-TestExample-frameworks.sh
In my case the error was caused by the lack of space on my machine. Deleting old builds fixed the problem.
In Xcode 12.4, after hours of try found the solution to this.
Go to Target > Architectures
Set Build Active Architecture Only to YES
and Excluded Architectures to x86_64
try this step if you need: Xcode 11.5
1- open terminal: cd Path_project
2- cd pod clean
3- pod install
if nothing change make this step
1- open Build Phases for target -> [CP] Embed Pods FrameWork
check this field
Another reason for the error might be is that Xcode is running a script during the run phase.
If this is the case, you have 2 options:
Delete the script (makes sense if the script is NOT important)
Modify/update the scripts location path (Xcode might not be able to locate the script)
In my case, the script was important, so I modified/updated its location.
Originally, the script location path was written like this:
$SRCROOT/scripts/clean-assets.sh
Because the scripts path contained spaces (I moved the project to a new directory), I changed the path to this:
"$SRCROOT"/scripts/clean-assets.sh
By adding quotes to SRCROOT, changing it to "$SRCROOT", the error will go away.
If you are doing Unity Project. You can get this error.
Command PhaseScriptExecution failed with a nonzero exit code
The solution is very simple
https://forum.unity.com/threads/error-on-build.561706/
Pre-requisites: Have cocoapods installed
Not Needed: 1. Install "cocoapods"
for installing run following line in your terminal: $sudo gem install cocoapods
Open your project folder using terminal
Run this line: chmod +x MapFileParser.sh
Run this line: chmod +x process_symbols.sh
It worked for me)
I think that installing "cocoapods" is not necessary, only step 3 and 4 enough to solve, but it does not work, you can try it.
If you experience this issue in flutter. Try running the application on a real iPhone device from other IDE like android studio or vs code.
The issue was flutter SDK missing iOS-profile-release.
So by running the flutter command
flutter run
It downloads the missing things before running and this solves the problem.
solution for me, none of these arch -x86_64 pod install and etc does not work until I did these steps:
run sudo gem install ffi in terminal.
then run arch -x86_64 pod install and build again.
and worked fine.
In terminal go to project path and follow the below steps
pod deintegrate
pod cache clean --all
pod install
For Xcode 11, React Native development environment.
I usually have this problem when a dependency is not updated.
You can try following these steps, this usually works for me:
1- Delete your Podfile.lock (I like to use the command '-rm -rf Podfile.lock' on the terminal for this)
2- Delete your Pods folder (I like to use the command '-rm -rf Pods' in the terminal for this)
3- Delete your .xcworkspace
4- Pod install
5- Clear your project into XCode> Product> Clean Build Folder
I got the error while using react-native-config.
Got this error since I had an empty line in .env files...
FIRST_PARAM=SOMETHING
SECOND_PARAM_AFTER_EMPTY_LINE=SOMETHING
3 hours wasted, maybe will save someone time
I have a project in React Native and suddenly this error appeared. I was doing something with homebrew beforehand and this solved the issue for me:
brew update
brew upgrade
brew cleanup
By mistake I had uninstalled carthage from my system. Adding that fixed the issue for me.
Step 1:
Download & install latest carthage DMG here: Carthage
Step 2:
carthage update --platform iOS --cache-builds
Step 3:
Run project & enjoy. :)
I tried everything above nothing worked
for me it was a space in a folder name
/swift files/project a/code.xcworkspace ->
/swift_files/project_a/code.xcworkspace
did the trick If I looked deeper it was stopping at /swift
For me the reason was while changing name of app I added a single quote ' in name.
I tried different solution and ran into different errors, but at last, while renaming app, I did not include ' single quote and it solved the problem.
For me, the issue was with Sentry.
in Xcode navigate to targets->Build Phases
delete the Upload Debug Symbols to Sentry phase
clean the build folder and try the build again
I used flutter to create iOS project.
When build for Simulator, failed with the same error message.
It is solved by following work.
xCode 12.3
Build Settings->Build Active Architecture Only, set it to Yes.
I was able to resolve this error by remove file in Pods -> Targets Support Files -> Pods-AppName -> Pods-AppName-frameworks.sh. After removing that file again install pod using command pod install.
OR.
Try this:
-> quit xcode
-> install pod(again)
-> start xcode
Take Pods-resources.sh from project path and paste in Terminal
sudo chmod a+x "Pods-resources.sh file path here"
Example Usage:
sudo chmod a+x "/Users/path/Desktop-path/My Work-path/Pods/Pods-resources.sh"
I recently tried to setup Google Firebase Analytics for my Unity game. I am building it for iOS exclusively. I have not been able to get Firebase working unfortunately.
I am using Xcode 8.1, OSX 10.12.1, and Unity 5.5.0f3
Whenever I try to build to iOS from Unity, I get this error in console:
Error running cocoapods. Please ensure you have at least version 1.0.0. You can install cocoapods with the Ruby gem package manager:
sudo gem install -n /usr/local/bin cocoapods
pod setup
'pod --version' returned status: 127
output:
UnityEngine.Debug:LogError(Object)
Google.IOSResolver:Log(String, Boolean, LogLevel)
Google.IOSResolver:OnPostProcessInstallPods(BuildTarget, String)
UnityEditor.HostView:OnGUI()
I have tried just about every suggestion I could find online. I have installed Cocoapods version 1.1.1, and later I tried the beta version 1.2.0.beta.1, nothing has worked.
Typing "which pod" in my terminal yields: /usr/local/bin/pod
Typing "pod --version" in my terminal yields the correct version number (i.e.: 1.2.0.beta.1)
I cannot get this build to work in my game's project, or a completely empty project to which I just imported firebase and tried to build.
I also tried to get this working with the sample project at the following link with no success: https://github.com/firebase/quickstart-unity
I am out of ideas here... can anyone help?
Much appreciated!
Firebase engineer here.
The code reporting the error is here:
https://github.com/googlesamples/unity-jar-resolver/blob/b7a90e43d6c893622102ca53681f53a58dab1a24/source/IOSResolver/src/IOSResolver.cs#L760
unfortunately, it looks like we're not logging the stderr stream so it's tricky to see how this is failing.
It sounds like your pod tool is returning a non-zero error code, not sure why. For example, on my machine I see the following:
$ which pod
/usr/local/bin/pod
$ pod --version ; echo $?
1.1.1
0
As you can see "pod --version" is returning "0" (success).
Similarly, pulling the latest Cocoapods tool from github https://github.com/CocoaPods/CocoaPods yields:
cd CocoaPods
export RUBYLIB=$(cd lib ; pwd)
export COCOAPODS_NO_BUNDLER=1
$ ./bin/pod --version ; echo $?
1.2.0.beta.1
0
Where the same thing is happening, the pod tool is returning a success exit code.
Things to try:
Contact support#firebase.google.com - we'll be able to work directly with you to diagnose and resolve this issue.
Try changing your LANG variable, we've been tripped up by this code https://github.com/CocoaPods/CocoaPods/blob/8db5956/bin/pod#L3 in the past. It's supposed to be handled by https://github.com/googlesamples/unity-jar-resolver/blob/b7a90e4/source/IOSResolver/src/IOSResolver.cs#L743 but you never know.
If you feel brave, build https://github.com/googlesamples/unity-jar-resolver/ yourself (you should be able to run ./gradlew in the root directory to build the DLLs) then you can add the stderr reporting, post / diagnose the error you're running into.
Cheers,
Stewart
If you have this error in your output:
Failed to extract git version from `git --version` ("xcrun: error: active developer path (\"/Applications/Xcode.app/Contents/Developer\") does not exist\nUse `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.\nSee `man xcode-select` for more details.\n") (RuntimeError),
...and IF you have a different path to XCode (like in my case, I had Xcode beta), then you should run the command:
sudo xcode-select --switch /Applications/Xcode-beta.app/
Environment
Mac OS X Version 10.11.3 (15D21)
Xcode Version 7.2 (7C68)
Simulator Version 9.2 (SimulatorApp-643)
react-native-cli 0.1.10
node v5.5.0
What I did before running the app
npm install -g react-native-cli
react-native init DemoProjectDELETEME
cd ./DemoProjectDELETEME
react-native run-ios
I am new to React Native. When I try to run the default app on iOS simulator I got the following errors. I found a similar issue but it does not solve my problem.
Xcode6 can't run any app in simulator ( Domain = NSPOSIXErrorDomain, Code = 3 )
After restart the machine and simulator the issues still persistent.
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script /Users/x/Desktop/DemoProjectDELETEME/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/DemoProjectDELETEME.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/done.js:10
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/DemoProjectDELETEME.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:464:13)
at Object.execFileSync (child_process.js:484:13)
at _runIOS (runIOS.js:77:34)
at runIOS.js:24:5
at tryCallTwo (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (runIOS.js:23:10)
at Object.run (/Users/x/Desktop/DemoProjectDELETEME/node_modules/react-native/local-cli/cli.js:86:13)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:73:7)
Got the follower error when I am trying to launch the app from Xcode.
sudo npm start in project root solves the issue, but react-native run-ios still BUILD FAILED.
Thanks for your time viewing my question.
Try running react-native upgrade
See Github thread: https://github.com/facebook/react-native/issues/7308#issuecomment-219597774
For me port 8081 was in use :
lsof -n -i4TCP:8081
1.Go to File -> Project settings
2.Click the Advanced button
3.Select "Custom" and select "Relative to Workspace" in the pull down
4.Change "Build/Products" to "build/Build/Products"
5.click done, done
The problem is in the js file that builds and runs your app. Unless your project, scheme, and Product Name are all the same, you'll get errors, especially on simulators.
The good news is that I submitted a pull request that fixes the problem. Please go upvote it so we don't have worry about things breaking when we rename things.
For me I just needed to edit the iOS project build settings
Product Bundle Identifier was not set
You need to set it for both the Project and 2 Targets
Open your react-native project in Xcode
Create a new schema with project name.
the problem will be solved
Adding sudo in front of all commands solves the problem.
sudo react-native init ProjectName
sudo chmod 777 ProjectName
cd ProjectName
sudo react-native run-ios
For me, I needed to upgrade my version of XCode from Yosemite to Sierra.
This can be done via App Store > Updates.
What worked for me was running pod install from the ios directory
Running
npx pod-install
solved the problem for me.
Open Your Xcode project
Run it
You should have 2 errors from RCTSRWebSocket.m
add (void) to the beginning of both line :
SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
become
(void)SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
Save and Re-run your project with Xcode or terminal. It should work for sure. I have tested all the solution before, this one is the only who worked for me.
Surprisingly, this was the solution for me: Open the file Views/RTCScrollView.m in Xcode and change the variable _refreshControl to refreshControl. All occurrences of _refreshControl were already marked as errors. The new code becomes:
- (void)setRefreshControl:(RCTRefreshControl *)refreshControl
{
if (refreshControl) {
[refreshControl removeFromSuperview];
}
refreshControl = refreshControl;
[self addSubview:refreshControl];
}
I fixed my issue, you can try it if you are in the same condition.
I encountered the same error:
Print: Entry, ":CFBundleIdentifier", Does Not Exist
When I clone an existing react-native project from learning react native.
I initialize (using {react-native init yourProjectName}) a new project with the same name in a different directory
copy every useful *.ios.js file to this new project from the one I clone elsewhere.
This works for me.
Edit the file ,ProjectName/node_modules/react-native/local-cli/runIOS/runIOS.js
Line no 18 : replace the entire line of code with the following :
return `build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app`;
Line no: 146: uncomment '-derivedDataPath', 'build',
after that run the command from the terminal: sudo react-native run-ios
For me, my problem was that Mcafee is running on port 8081, so I run the app on a different port following this answer https://stackoverflow.com/a/50649969/5323419
Basically:
react-native run-ios --port 1234
react-native start --port 1234
I am using React native 0.55+
Try to run
npx pod-install
Also check the permissions. Maybe you should run react-native run-ios with sudo?
For my case:
If your project folder name called like "Example Project"
You must change it to "Example_Project"
Spaces are causen this error.