解决升级到Xcode10,react native项目运行报错问题

Posted honeynm

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决升级到Xcode10,react native项目运行报错问题相关的知识,希望对你有一定的参考价值。

今天刚升级到Xcode10,就遇到两个报错问题

错误一:Xcode 10: Build input file double-conversion cannot be found

error: Build input file cannot be found: ‘../node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc‘

configure: error: in `../node_modules/react-native/third-party/glog-0.3.4‘

react-native run-ios
Found Xcode project awesome.xcodeproj
Launching iPhone 6 (iOS 12.0)...
Building using "xcodebuild -project awesome.xcodeproj -configuration Debug -scheme awesome -destination id=F0EA48DA-E7A0-4E8F-92B3-3D4A2AA93B76 -derivedDataPath build"
? Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.h
? Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/yoga/yoga/YGEnums.h
? Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/yoga/yoga/YGMacros.h
? Compiling YGStyle.cpp
? Compiling YGLayout.cpp
? Compiling Yoga.cpp
? Compiling YGNode.cpp
? Compiling YGNodePrint.cpp
? Compiling YGFloatOptional.cpp
? Compiling YGEnums.cpp
? Compiling Utils.cpp
? Analyzing Yoga.cpp
? Analyzing YGStyle.cpp
? Analyzing YGNodePrint.cpp
? Analyzing YGNode.cpp
? Analyzing YGLayout.cpp
? Analyzing YGFloatOptional.cpp
? Analyzing YGEnums.cpp
? Analyzing Utils.cpp
? Building library libyoga.a
? Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/jsinspector/InspectorInterfaces.h
? Compiling InspectorInterfaces.cpp
? Analyzing InspectorInterfaces.cpp
? Building library libjsinspector.a
? Copying /Users/rod/dev/react/testing/awesome/node_modules/react-native/ReactCommon/privatedata/PrivateDataBase.h
? Compiling PrivateDataBase.cpp
? Analyzing PrivateDataBase.cpp
? Building library libprivatedata.a
? Running script ‘Install Third Party‘
? Compiling strtod.cc
? error: Build input file cannot be found: ‘/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc‘
? Compiling fast-dtoa.cc
? error: Build input file cannot be found: ‘/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fast-dtoa.cc‘
? Compiling fixed-dtoa.cc
? error: Build input file cannot be found: ‘/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fixed-dtoa.cc‘
? Compiling double-conversion.cc
? error: Build input file cannot be found: ‘/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/double-conversion.cc‘
? Compiling diy-fp.cc
? error: Build input file cannot be found: ‘/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/diy-fp.cc‘
? Compiling cached-powers.cc
? error: Build input file cannot be found: ‘/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/cached-powers.cc‘
? Compiling bignum.cc
? error: Build input file cannot be found: ‘/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/bignum.cc‘
** BUILD FAILED **
The following build commands failed:
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/strtod.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/strtod.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/fast-dtoa.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fast-dtoa.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/fixed-dtoa.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/fixed-dtoa.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/double-conversion.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/double-conversion.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/diy-fp.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/diy-fp.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/cached-powers.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/cached-powers.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/rod/dev/react/testing/awesome/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Objects-normal/x86_64/bignum.o /Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.1.6/src/bignum.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(7 failures)
Installing build/Build/Products/Debug-iphonesimulator/awesome.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application‘s Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/awesome.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist


Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/awesome.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

at checkExecSyncError (child_process.js:602:13)
at Object.execFileSync (child_process.js:622:13)
at Promise.then (/Users/rod/dev/react/testing/awesome/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
解决办法,在项目文件夹下执行:

第一步

cd node_modules/react-native/scripts && ./ios-install-third-party.sh && cd ../../../
第二步 

cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
 注意:第二步命令“golg-0.3.5”需要改成你的glog版本,比如我的是“golg-0.3.4”,则改成

cd node_modules/react-native/third-party/glog-0.3.4/ && ../../scripts/ios-configure-glog.sh && cd ../../../../
可以在以下文件夹查看你的golg,如图 

 

第三步重启服务:npm start 

 

错误二:error: Build input file cannot be found: ‘../node_modules/react-native/Libraries/WebSocket/libfishhook.a‘

这是缺少libfishhook.a文件造成的,我们可以手动添加它,如图:

 

 

 


---------------------
作者:SemperChan
来源:CSDN
原文:https://blog.csdn.net/chensenp/article/details/83543724
版权声明:本文为博主原创文章,转载请附上博文链接!





















































































以上是关于解决升级到Xcode10,react native项目运行报错问题的主要内容,如果未能解决你的问题,请参考以下文章

升级到 Xcode8 后 React Native RCTCustomScrollView 损坏

react-native xcode 10.1“config.h”文件未找到

如何从 React ^0.14.8 & React-native ^0.24.1 升级到 React 15.0.2 和 React-native 0.26.3

升级mac os和升级xcode后如何运行`npm react-native run-ios`?

构建错误:升级到 Xcode 10 后找不到 FBSDKShareKit.h 文件

react-native 在iOS上使用http链接的图片地址不显示| iOS9 & iOS10 HTTP 不能正常使用的解决办法