Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native run-ios takes forever to build and sometimes never does

I start my app with react-native run-ios and i get left at this portion of the build process, sometimes indefinitely. why does this happen?

Alexs-MBP:swig_app alexhome$ react-native run-ios Found Xcode project swig_app.xcodeproj Building using "xcodebuild -project swig_app.xcodeproj -configuration Debug -scheme swig_app -destination id=C46C9065-C23A-4118-AB00-5957B64086B1 -derivedDataPath build" User defaults from command line:

IDEDerivedDataPathOverride = /Users/alexhome/Desktop/swig_app/ios/build

Ive tried all the usual cleaning commands such as watchman watch-del-all and virtuall ever other cache cleaning command there is. sometimes the make it worse tho

package.Json:

{ "name": "swig_app", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.6.3", "react-native": "0.57.8", "react-native-router-flux": "^4.0.6", "react-redux": "^6.0.0", "redux": "^4.0.1" }, "devDependencies": { "babel-jest": "23.6.0", "jest": "23.6.0", "metro-react-native-babel-preset": "0.51.1", "react-test-renderer": "16.6.3" }, "jest": { "preset": "react-native" } }

like image 843
Alex Berman Avatar asked Dec 23 '18 02:12

Alex Berman


People also ask

How do I speed up react in native build time?

Build only one ABI during development (Android-only)​ This should reduce your build time by a ~75% factor. If you're using the React Native CLI, you can use the --active-arch-only flag together with the run-android command.

How much time a react native build takes?

Mine takes 10-20 minutes at the first build.


2 Answers

I had a similar situation happen to me recently after I deleted the build file in the IOS folder. I ran react-native run-ios and it was stuck in the same place forever. I then tried opening the project in Xcode and realized Xcode was not opening the project at all and so react-native could not build the project. I restarted my computer, tried opening the project again in Xcode and when that worked, I closed it and ran react-native run-ios and everything went back to normal.

like image 92
Uma Avatar answered Nov 15 '22 05:11

Uma


run killall -9 node to kill the all node processes.

like image 31
Nikita Zhigamovsky Avatar answered Nov 15 '22 03:11

Nikita Zhigamovsky