简体   繁体   中英

Running react-native apps on iOS emulators

So I am trying to run a simple react-native app on an iPhone 11 - 13.2.2 emulator.

I type npm run ios but I get this back.

** BUILD FAILED **


The following build commands failed:
        CompileC /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/build/confusion/Build/Intermediates.noindex/confusion.build/Debug-iphonesimulator/confusion.build/Objects-normal/x86_64/AppDelegate.o /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/confusion/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
        CompileC /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/build/confusion/Build/Intermediates.noindex/confusion.build/Debug-iphonesimulator/confusion.build/Objects-normal/x86_64/main.o /Users/theodosiostziomakas/Desktop/React-Native/confusion/ios/confusion/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ ios: `react-native run-ios`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ 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/theodosiostziomakas/.npm/_logs/2019-11-16T12_38_06_754Z-debug.log

I used npm install but still nothing. How to fix that error?

Thanks, Theo.

alternatively you can run from the workspace file, sometimes running from npm in ios will not give you the exact error. You have to run the following file in your workspace and select the simulator/iphone and finally launch the project.

Path to the workspace:- ProjectFolder/ios/projectname.xcworkspace

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