最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - React Native creating app & running it on xcode getting error ReactCodegen - Stack Overflow

programmeradmin1浏览0评论

I was creating a normal app in React-Native with the following commands.

npx react-native init sampleApp && cd ios && pod install

When running the app in xcode getting this:

ReactCodegen: Command PhaseScriptExecution failed with a nonzero exit code

I tried all of these

cd ios
rm .xcode.env.local
rm .xcode.env
pod deintegrate
rm -rf ./build
rm Podfile.lock
cd ..
rm -rf ./node_modules
npm install
cd ios
pod install
open xcode
Product -> Clear all issues
Product -> Clean build folder
click play

In the end, it still did not work.

I installed Ruby

ruby --version
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-darwin23]

also made this

sudo gem install cocoapods
pod setup

pod cache clean --all

xcode-select --install

npx react-native start --reset-cache

npm install

But still after all this effort, the error keeps appearing.

Anyone can help me, please?

I was creating a normal app in React-Native with the following commands.

npx react-native init sampleApp && cd ios && pod install

When running the app in xcode getting this:

ReactCodegen: Command PhaseScriptExecution failed with a nonzero exit code

I tried all of these

cd ios
rm .xcode.env.local
rm .xcode.env
pod deintegrate
rm -rf ./build
rm Podfile.lock
cd ..
rm -rf ./node_modules
npm install
cd ios
pod install
open xcode
Product -> Clear all issues
Product -> Clean build folder
click play

In the end, it still did not work.

I installed Ruby

ruby --version
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-darwin23]

also made this

sudo gem install cocoapods
pod setup

pod cache clean --all

xcode-select --install

npx react-native start --reset-cache

npm install

But still after all this effort, the error keeps appearing.

Anyone can help me, please?

Share Improve this question edited Nov 23, 2024 at 6:12 Thomasino73 9776 silver badges22 bronze badges asked Nov 20, 2024 at 22:51 Taha HalabiTaha Halabi 1717 bronze badges 6
  • Did you create the .xcode.env & .xcode.env.local back after deleting them? Setup link – mahmoudafer Commented Nov 21, 2024 at 0:50
  • No,how to create them? Also these files don’t exist when creating React native project (npx react-native init SampleApp) – Taha Halabi Commented Nov 21, 2024 at 2:20
  • I shared the setup link, in my comment, check it – mahmoudafer Commented Nov 21, 2024 at 7:45
  • 1 I already tried it & error still – Taha Halabi Commented Nov 21, 2024 at 7:50
  • At this point, there is not enough context to be able to assist. Your best bet, since it's a new project, to just create a new one and copy any logic you set up, if the error persists, then post your app logic to figure out in which part this is happening. – mahmoudafer Commented Nov 21, 2024 at 14:54
 |  Show 1 more comment

1 Answer 1

Reset to default 0

I had this issue when using npx expo run:ios in VSCode or running in Xcode. What worked for me was giving Full Disk Access to Xcode, Visual Studio Code, and Terminal.

You can do this in macOS through System Settings -> Privacy & Security -> Full Disk Access

发布评论

评论列表(0)

  1. 暂无评论