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

javascript - Build Hangs While Running 'react-native run-ios' - Stack Overflow

programmeradmin0浏览0评论

I am stuck on a problem. While running commnand from cli react-native run-ios

Found Xcode project myproject.xcodeproj
Launching iPhone 6 (iOS 10.3)...
Building using "xcodebuild -project myproject.xcodeproj -configuration Debug -scheme myproject -destination id=CB73A374-3E21-4C73-BEC4-AD29A583FCE8 -derivedDataPath build"
User defaults from command line:

IDEDerivedDataPathOverride = /Users/.../myproject/ios/build

It just hangs and then nothing happens, no response.

I already checked an earlier question in stackoverflow and issue in github, but got no help. I may have asked a duplicate question but I am in badly need of a solution. Any help will be highly appreciated.

I am stuck on a problem. While running commnand from cli react-native run-ios

Found Xcode project myproject.xcodeproj
Launching iPhone 6 (iOS 10.3)...
Building using "xcodebuild -project myproject.xcodeproj -configuration Debug -scheme myproject -destination id=CB73A374-3E21-4C73-BEC4-AD29A583FCE8 -derivedDataPath build"
User defaults from command line:

IDEDerivedDataPathOverride = /Users/.../myproject/ios/build

It just hangs and then nothing happens, no response.

I already checked an earlier question in stackoverflow and issue in github, but got no help. I may have asked a duplicate question but I am in badly need of a solution. Any help will be highly appreciated.

Share Improve this question edited Oct 15, 2017 at 12:31 Tahmid Rahman asked Oct 15, 2017 at 11:36 Tahmid RahmanTahmid Rahman 7581 gold badge8 silver badges21 bronze badges 3
  • 1 Any luck with this? Unfortunately, none of the options below help... – njho Commented Mar 1, 2019 at 19:49
  • Anyone has answer? – asedra_le Commented Apr 26, 2019 at 11:43
  • Well I bypassed the problem by building from xcode – Tahmid Rahman Commented Apr 26, 2019 at 11:52
Add a comment  | 

4 Answers 4

Reset to default 5

I know this is way later than the question was asked, but since it was never answered, I wanted to throw this up here cause it just happened to me.

I got past that by doing rm -rf node_modules/ and then doing npm install.

Hope this helps someone else in the future as well! :-D

This resolved the problem for me, Under project.workspace, there is a file called "contents.xcworkspacedata".(This can be opened from your IDE) There was a duplication of the fileref tag, removed one and ran react-native run-ios, and it worked.

<FileRef
      location = "group:project.xcodeproj">
   </FileRef>

For someone stuck on it in 2023, for me just trying to start a React Native project following their documentation did not work.

My Mac is M1, which caused a lot of different issues. Eventually, I solved it by:

  1. Making sure my ruby version was correct. I used a combination of arch -arm64 rvm install 2.7.6 (The version being latest Ruby version required on boilerplate React Native project). Then to use the version, rvm use 2.7.6. I then initiated my React Native project using arch -arm64 npx react-native init <ProjectName>. Rest of the commands such as npx react-native run-ios worked as usual.
  2. Moving the project away from iCloud Drive folder fixed it from being stuck on "Building the app..." (Still takes a while to build).

I spent my weekend trying to solve this. Hope this helps.

Another solution:

  • close your IDE

  • run in a terminal:

sudo kill -9 `ps aux | grep node | grep -v grep | awk '{print $2}'`
  • Re-open your IDE
  • re-run: (npx) react-native run-ios
发布评论

评论列表(0)

  1. 暂无评论