react-native-firebase-starter icon indicating copy to clipboard operation
react-native-firebase-starter copied to clipboard

Unable to run npm run iOS

Open sumitsharma14k opened this issue 6 years ago • 6 comments

This is the issue I am facing. I tried some solution but it didn't work. Solution I tried: https://stackoverflow.com/questions/42308879/npm-err-code-elifecycle#49505612

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening calleFirebase.xcworkspace

** BUILD FAILED **

The following build commands failed: CompileC /Users/shayana/Documents/Calle/calleFirebase/ios/build/calleFirebase/Build/Intermediates.noindex/calleFirebase.build/Debug-iphonesimulator/calleFirebase.build/Objects-normal/x86_64/main.o /Users/shayana/Documents/Calle/calleFirebase/ios/calleFirebase/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) . Run CLI with --verbose flag for more details. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] ios: react-native run-ios --simulator="iPhone X" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] ios script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/shayana/.npm/_logs/2019-08-25T11_33_57_530Z-debug.log

sumitsharma14k avatar Aug 25 '19 11:08 sumitsharma14k

That error output doesn't contain the actual error.

You can always try npm i react-native-clean-project && react-native clean-project-auto to make sure your Xcode build is actually really clean

The starter builds and works correctly for ios last I checked

An alternative approach is to use this to get a completely clean project initialized from scratch that builds and runs https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

mikehardy avatar Aug 25 '19 14:08 mikehardy

I tried your first solution but still I'm getting the same error.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/shayana/.npm/_logs/2019-08-25T14_42_42_357Z-debug.log

vi /Users/shayana/.npm/_logs/2019-08-25T14_42_42_357Z-debug.log

1 0 info it worked if it ends with ok 2 1 verbose cli [ 3 1 verbose cli '/usr/local/Cellar/node/12.7.0/bin/node', 4 1 verbose cli '/usr/local/bin/npm', 5 1 verbose cli 'run', 6 1 verbose cli 'ios' 7 1 verbose cli ] 8 2 info using [email protected] 9 3 info using [email protected] 10 4 verbose run-script [ 'preios', 'ios', 'postios' ] 11 5 info lifecycle [email protected]~preios: [email protected] 12 6 info lifecycle [email protected]~ios: [email protected] 13 7 verbose lifecycle [email protected]~ios: unsafe-perm in lifecycle true 14 8 verbose lifecycle [email protected]~ios: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/shayana/Documents/Calle/calleFirebase/node_modules/.bin:/Users/shayana /Downloads/kaldi/tools/python:/opt/local/bin:/opt/local/sbin:/Users/shayana/Downloads/srilm/bin/macosx:/Users/shayana/Downloads/srilm/bin:/Users/shayana/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/Us ers/shayana/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/mysql/bin:/Users/shayana/Library/Android/sdk/emulator:/Users/shayana/Library/Android/sdk/tools:/Users/shay ana/Library/Android/sdk/tools/bin:/Users/shayana/Library/Android/sdk/platform-tools:/Users/shayana/Downloads/kaldi/tools/irstlm/bin 15 9 verbose lifecycle [email protected]~ios: CWD: /Users/shayana/Documents/Calle/calleFirebase 16 10 silly lifecycle [email protected]~ios: Args: [ '-c', 'react-native run-ios --simulator="iPhone X"' ] 17 11 silly lifecycle [email protected]~ios: Returned: code: 1 signal: null 18 12 info lifecycle [email protected]~ios: Failed to exec ios script 19 13 verbose stack Error: [email protected] ios: react-native run-ios --simulator="iPhone X" 20 13 verbose stack Exit status 1 21 13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:326:16) 22 13 verbose stack at EventEmitter.emit (events.js:203:13) 23 13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 24 13 verbose stack at ChildProcess.emit (events.js:203:13) 25 13 verbose stack at maybeClose (internal/child_process.js:1021:16) 26 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) 27 14 verbose pkgid [email protected] 28 15 verbose cwd /Users/shayana/Documents/Calle/calleFirebase 29 16 verbose Darwin 18.7.0 30 17 verbose argv "/usr/local/Cellar/node/12.7.0/bin/node" "/usr/local/bin/npm" "run" "ios" 31 18 verbose node v12.7.0 32 19 verbose npm v6.10.2 33 20 error code ELIFECYCLE 34 21 error errno 1 35 22 error [email protected] ios: react-native run-ios --simulator="iPhone X" 36 22 error Exit status 1 37 23 error Failed at the [email protected] ios script. 38 23 error This is probably not a problem with npm. There is likely additional logging output above. 39 24 verbose exit [ 1, true ]

sumitsharma14k avatar Aug 25 '19 14:08 sumitsharma14k

this looks like a react-native problem nothing specific to react-native-firebase

Make sure you can follow this guide completely https://facebook.github.io/react-native/docs/getting-started.html

I must say I can't really recommend this starter at the moment since it will give you a react-native 0.59 project (it hasn't been upgraded yet) and then you'll immediately have the chore of updating it to react-native 0.60. A huge waste of effort. I'd use my rnfbdemo script at this point. You'll still need to do the react-native getting started guide to prove you have things working though or it'll fail also.

Additionally, you're going to want to upgrade node to 12.9.0 at least or you'll have a really irritating performance bug every time you run react-native start

mikehardy avatar Aug 25 '19 14:08 mikehardy

I was able to run my project initially. But when I tried to add firebase to it, I got this issue. I am following this:

https://github.com/invertase/react-native-firebase-starter

sumitsharma14k avatar Aug 25 '19 15:08 sumitsharma14k

Yeah, you're logging an issue in this project so I'm assuming you're using this project. However, this is project is a base for further development. You should not use it to add firebase to an existing project, it's not meant for that.

If you want to add firebase to an existing project you need to read the correct parts of rnfirebase.io and/or look at the scripted steps I demonstrate https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh

I don't believe this is a react-native-firebase-starter bug. Changing my mind on that would require demonstration that you can clone this repo, follow the instructions exactly in the readme, and get a build failure. I think it builds correctly when do that / use as intended

mikehardy avatar Aug 25 '19 16:08 mikehardy

Thanks Mike. I will try to do what you are suggesting.

sumitsharma14k avatar Aug 25 '19 18:08 sumitsharma14k