Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build Hangs While Running 'react-native run-ios'

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.

like image 519
Tahmid Rahman Avatar asked Oct 15 '17 11:10

Tahmid Rahman


People also ask

Can React Native run on iOS?

Once you have your React Native project initialized, you can run npx react-native run-ios inside the newly created project directory. If everything is set up correctly, you should see your new app running in the iOS Simulator shortly.

Can React Native run on both iOS and Android?

With React Native, developers can write real, natively rendering mobile applications for iOS and Android. It helps build apps on two platforms at once, while maintaining the look, feel, and productivity of an app built on the specific iOS or Android platform.

Can I build iOS app on Windows React Native?

It is possible to build an iOS app on Windows with React Native. With efficient tools like Codemagic, you don't need to own a MacBook to build an iOS app. Codemagic automates the process of deployment and handles all the difficult jobs for you. That way, all you have to do is focus on building your app.

Do you need Xcode to run React Native?

If you are already familiar with mobile development, you may want to use React Native CLI. It requires Xcode or Android Studio to get started. If you already have one of these tools installed, you should be able to get up and running within a few minutes.


2 Answers

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

like image 73
Emit Dutcher Avatar answered Sep 18 '22 13:09

Emit Dutcher


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>
like image 28
Nicholas Francis Avatar answered Sep 20 '22 13:09

Nicholas Francis