简体   繁体   中英

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" } }

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.

运行killall -9 node以终止所有节点进程。

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" } }

This usually happens on first build, so simple resolution is to quit the running process and then delete the ios/build directory after that rerun the command "react-native run-ios" again.

For more information refer to this thread

https://github.com/facebook/react-native/issues/24815

May be this helps you or somebody else, Thanks!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM