Closed offcarlospetit closed 10 months ago
same issue here
same issue!!!
same issue here
its rare, because a i have another macbook with the same config and works perfectly
a lot of people are having the same issue. Many solved it by finding that their project path has 'space' like '/Users/SomeFolder/Some Project'. They removed the space as '/Users/SomeFolder/SomeProject' and got it working. You should check your project path. I dont have any space in my project path but it still aint working
a lot of people are having the same issue. Many solved it by finding that their project path has 'space' like '/Users/SomeFolder/Some Project'. They removed the space as '/Users/SomeFolder/SomeProject' and got it working. You should check your project path. I dont have any space in my project path but it still aint working
i created a new project called "project" and check every single space and nothing, still doesn't work
i have same issue . After 4 hour research . I found the my mistake . My path folder as "/Users/Some Folder/Project". You should create project without space any sub-folder , like this "/Users/SomeFolder/Project" And i have solved my problem I hope it's useful for you
i have same issue . After 4 hour research . I found the my mistake . My path folder as "/Users/Some Folder/Project". You should create project without space any sub-folder , like this "/Users/SomeFolder/Project" And i have solved my problem I hope it's useful for you
unfortunately still not working, try to uninstall xcode, node, yarn, reinstall cocoa, and nothing
same issue!!!
0.64 does not work, I switched to 0.62, 0.62 works --!
same issue!!!
0.64 does not work, I switched to 0.62, 0.62 works --!
Did you try version 0.63?
same issue!!!
0.64 does not work, I switched to 0.62, 0.62 works --!
I gave up 0.64.Waste me a long time
same issue!!!
0.64 does not work, I switched to 0.62, 0.62 works --!
I gave up 0.64.Waste me a long time
I have an application with 0.64 in the application store and I am afraid to change the version
same issue!!!
0.64 does not work, I switched to 0.62, 0.62 works --!
Did you try version 0.63?
i'm going to try
same issue!!!
0.64 does not work, I switched to 0.62, 0.62 works --!
I gave up 0.64.Waste me a long time
I have an application with 0.64 in the application store and I am afraid to change the version
Mine is a new project
same issue!!!
0.64 does not work, I switched to 0.62, 0.62 works --!
Did you try version 0.63?
BUILD FAILED
0.63 doesn't work The following build commands failed: CompileC /Users//Library/Developer/Xcode/DerivedData/AwesomeProje63-bnceouugnrmkkmhkgiiwcwpepobk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users//AwesomeProje63/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure)
same issue!!!
0.64 does not work, I switched to 0.62, 0.62 works --!
Did you try version 0.63?
BUILD FAILED
0.63 doesn't work The following build commands failed: CompileC /Users//Library/Developer/Xcode/DerivedData/AwesomeProje63-bnceouugnrmkkmhkgiiwcwpepobk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Flipper.build/Objects-normal/x86_64/FlipperRSocketResponder.o /Users//AwesomeProje63/ios/Pods/Flipper/xplat/Flipper/FlipperRSocketResponder.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure)
haha it was just doing the same and it produced the same error, it's frustrating
I'm using React 0.64. Xcode 12.2 , IDE: Visual Code I tried change path on exist Project which build fail but it doesn't work. That's mean , if you have a project fail building and you try change your project path , it doesn't work too. So you should following solution :
I have the same issue. I have init a new project with 0.64, it doesn't work and pod install error.
Same here, impossible to install cocoapod dependencies.
Xcode: 12.3 MacOS:11.1 IDE: Visual Code or WebStorm I initialized a new project with version 0.64. step1: sudo gem install cocoapods pod version: 1.10.1 step2: pod repo update step3: pod install step4: Xcode run the project Working smoothly
Same here, 0.64 is a mess. iOS build is failing on newly created projects.
+1
npx react-native init App
-> yarn ios
Fails in the terminal.
It works for me to run the project through xCode.
There seems to be an issue with coreutils
on macOS.
What fixed it for me is:
brew install coreutils
brew install findutils
brew install gnu-sed
Finally change the node_modules/react-native/scripts/generate-specs.sh
to:
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# This script collects the JavaScript spec definitions for core
# native modules and components, then uses react-native-codegen
# to generate native code.
#
# Optionally, set these envvars to override defaults:
# - SRCS_DIR: Path to JavaScript sources
# - CODEGEN_MODULES_LIBRARY_NAME: Defaults to FBReactNativeSpec
# - CODEGEN_MODULES_OUTPUT_DIR: Defaults to React/$CODEGEN_MODULES_LIBRARY_NAME/$CODEGEN_MODULES_LIBRARY_NAME
# - CODEGEN_COMPONENTS_LIBRARY_NAME: Defaults to rncore
# - CODEGEN_COMPONENTS_OUTPUT_DIR: Defaults to ReactCommon/react/renderer/components/$CODEGEN_COMPONENTS_LIBRARY_NAME
#
# Usage:
# ./scripts/generate-specs.sh
# SRCS_DIR=myapp/js CODEGEN_MODULES_LIBRARY_NAME=MySpecs CODEGEN_MODULES_OUTPUT_DIR=myapp/MySpecs ./scripts/generate-specs.sh
#
# shellcheck disable=SC2038
set -e
THIS_DIR=$(cd -P "$(gdirname "$(greadlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
TEMP_DIR=$(gmktemp -d /tmp/react-native-codegen-XXXXXXXX)
RN_DIR=$(cd "$THIS_DIR/.." && pwd)
# find node path
source "$RN_DIR/scripts/find-node.sh"
NODE_BINARY="${NODE_BINARY:-$(command -v node || true)}"
USE_FABRIC="${USE_FABRIC:-0}"
cleanup () {
set +e
grm -rf "$TEMP_DIR"
set -e
}
describe () {
printf "\\n\\n>>>>> %s\\n\\n\\n" "$1"
}
main() {
SRCS_DIR=${SRCS_DIR:-$(cd "$RN_DIR/Libraries" && pwd)}
CODEGEN_MODULES_LIBRARY_NAME=${CODEGEN_MODULES_LIBRARY_NAME:-FBReactNativeSpec}
CODEGEN_COMPONENTS_LIBRARY_NAME=${CODEGEN_COMPONENTS_LIBRARY_NAME:-rncore}
CODEGEN_MODULES_OUTPUT_DIR=${CODEGEN_MODULES_OUTPUT_DIR:-"$RN_DIR/React/$CODEGEN_MODULES_LIBRARY_NAME/$CODEGEN_MODULES_LIBRARY_NAME"}
# TODO: $CODEGEN_COMPONENTS_PATH should be programmatically specified, and may change with use_frameworks! support.
CODEGEN_COMPONENTS_PATH="ReactCommon/react/renderer/components"
CODEGEN_COMPONENTS_OUTPUT_DIR=${CODEGEN_COMPONENTS_OUTPUT_DIR:-"$RN_DIR/$CODEGEN_COMPONENTS_PATH/$CODEGEN_COMPONENTS_LIBRARY_NAME"}
TEMP_OUTPUT_DIR="$TEMP_DIR/out"
SCHEMA_FILE="$TEMP_DIR/schema.json"
if [ -z "$NODE_BINARY" ]; then
echo "Error: Could not find node. Make sure it is in bash PATH or set the NODE_BINARY environment variable." 1>&2
exit 1
fi
CODEGEN_PATH=$("$NODE_BINARY" -e "console.log(require('path').dirname(require.resolve('react-native-codegen/package.json')))")
# Special case for running CodeGen from source: build it
if [ ! -d "$CODEGEN_PATH/lib" ]; then
describe "Building react-native-codegen package"
bash "$CODEGEN_PATH/scripts/oss/build.sh"
fi
describe "Generating schema from flow types"
"$NODE_BINARY" "$CODEGEN_PATH/lib/cli/combine/combine-js-to-schema-cli.js" "$SCHEMA_FILE" "$SRCS_DIR"
describe "Generating native code from schema (iOS)"
pushd "$RN_DIR" >/dev/null || exit 1
"$NODE_BINARY" scripts/generate-specs-cli.js ios "$SCHEMA_FILE" "$TEMP_OUTPUT_DIR" "$CODEGEN_MODULES_LIBRARY_NAME"
popd >/dev/null || exit 1
describe "Copying output to final directory"
gmkdir -p "$CODEGEN_COMPONENTS_OUTPUT_DIR" "$CODEGEN_MODULES_OUTPUT_DIR"
gcp -R "$TEMP_OUTPUT_DIR/$CODEGEN_MODULES_LIBRARY_NAME.h" "$TEMP_OUTPUT_DIR/$CODEGEN_MODULES_LIBRARY_NAME-generated.mm" "$CODEGEN_MODULES_OUTPUT_DIR" || exit 1
gfind "$TEMP_OUTPUT_DIR" -type f | gxargs gsed -i.bak "s/$CODEGEN_MODULES_LIBRARY_NAME/$CODEGEN_COMPONENTS_LIBRARY_NAME/g" || exit 1
gfind "$TEMP_OUTPUT_DIR" -type f -not -iname "$CODEGEN_MODULES_LIBRARY_NAME*" -exec cp '{}' "$CODEGEN_COMPONENTS_OUTPUT_DIR/" ';' || exit 1
echo >&2 'Done.'
}
trap cleanup EXIT
main "$@"
notice that some commands are starting with g
like greadlink
etc.
if your get invalid identifier
error in react-native-xcode.sh
then under Build Phases
-> Bundle React Native code and images
it should be: (notice the double quotes):
set -e
export NODE_BINARY="node ../node_modules/react-native/scripts/react-native-xcode.sh"
use patch-package react-native
to patch it (if project is being developed on different machines then they must install the brew packages above)
To get a new init to work is one thing, but if installing/updating packages is necessary then it needs to be in the official docs over in environment setup. Who want's to init a new project all according to the docs only to find out that right out the gate it needs more steps, or hours of googling just to show the welcome screen. (on iOS)
I could actually solve my problem in a bare RN project by re-installing nvm and then reinstalling all dependancies in the project.
Rough steps:
installing nvm, docs in their official repo: https://github.com/nvm-sh/nvm
Then I reinstalled node: nvm install node && nvm alias default node
Then I deleted the following things from my project:
Then I reinstalled node_modules yarn
Then cd ios
-> pod install --repo-update
Finally I could go and start the simulator as normal npx react-native run-ios
Hope that helps someone.
My solutions:
# This issue:
## Disable bad script for PhaseScriptExecution
rm node_modules/react-native/scripts/find-node.sh
touch node_modules/react-native/scripts/find-node.sh
# Other issue
## Not Found ios/main.jsbundle: https://github.com/facebook/react-native/issues/31094
touch ios/main.jsbundle
In my case it helped upgrading nvm, following this guide: https://github.com/nvm-sh/nvm#manual-upgrade
Same here, but 0.63 build Success
I had the same situation. I looked to a file that call script generate-specs.sh and I found ios/Pods/Pods.xcodeproj/project.pbxproj. I tried to change bash to zsh (because it is default in my laptop). And build is started working. Then I tried to find reason why bash didn't work and I have found.
Look at my ~/.bash_profile before changes:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$HOME/Library/Python/3.7/bin
In the last line $PATH:
was missed, I have added it and my building starts working:
export PATH=$PATH:$HOME/Library/Python/3.7/bin
Check all lines with export PATH
in your ~/.bash_profile and ensure that all these lines not override previous value (have $PATH:
afret =
).
I found the solution after hours of debugging you need to modify this file for now.
/node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
I found the solution after hours of debugging you need to modify this file for now.
- Edit this file
/node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh
- Add this line
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
- Then run the project using Xcode it will work 100%
I've spent hours trying various other solutions and this is the only one that works
@LouiseReid I am glad my solution worked 😄
I found the solution after hours of debugging you need to modify this file for now.
- Edit this file
/node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh
- Add this line
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
- Then run the project using Xcode it will work 100%
Thank you very much @khanakia , saved my life 😊 Many people faced with this issue, some of them solved it by using different ways but non of them worked for me except yours ❤️
I found the solution after hours of debugging you need to modify this file for now.
- Edit this file
/node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh
- Add this line
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
- Then run the project using Xcode it will work 100%
I've spent hours trying various other solutions and this is the only one that works
Thank you khanakia ❤️
I just did a little update, i add this command line export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
to
/node_modules/react-native/scripts/generate-specs.sh
instead of /node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh
And its work.
I found the solution after hours of debugging you need to modify this file for now.
- Edit this file
/node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh
- Add this line
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
- Then run the project using Xcode it will work 100%
I've spent hours trying various other solutions and this is the only one that works
Thank you khanakia ❤️
I just did a little update, i add this command line
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
to
/node_modules/react-native/scripts/generate-specs.sh
instead of
/node_modules/react-native/React/FBReactNativeSpec/../../scripts/generate-specs.sh
And its work.
This worked for me. The directory in Step 1 above didn't exist in my node_modules folder so I did the same thing as ibenettaleb and it finally worked! Thank you! I've been looking at this for a couple of days now!
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
i have same issue . After 4 hour research . I found the my mistake . My path folder as "/Users/Some Folder/Project". You should create project without space any sub-folder , like this "/Users/SomeFolder/Project" And i have solved my problem I hope it's useful for you
This thing actually works for me. thanks!
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
I have updated Xcode to its latest version (Version 12.4 (12D4e)) and when creating a new app with the command npx react-native init AwesomeApp --template react-native-template-typescript
This is created without any problem, however when launching the app for ios it runs the following problem:
React Native version:
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Expected Results
The app build failed
Snack, code example, screenshot, or link to a repository: