1. 程式人生 > >解決升級到Xcode10,react native項目運行報錯問題

解決升級到Xcode10,react native項目運行報錯問題

failed 錯誤 lib blog ise ould path uil 執行

今天剛升級到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項目運行報錯問題