新的 react 原生项目可以react-native run-ios
在设备上运行,但不能通过 xcode 10 运行。
当我构建项目时,它会收到错误。
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/DoubleConversion'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/Folly'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-Core'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-DevSupport'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTActionSheet'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTAnimation'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTBlob'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTImage'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTLinking'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTNetwork'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTSettings'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTText'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTVibration'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTWebSocket'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-cxxreact'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-fishhook'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-jsi'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-jsiexecutor'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-jsinspector'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/glog'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/yoga'
ld: library not found for -lDoubleConversion
我需要在ios中添加一些本机模块,但现在我在xcode10中构建项目时遇到了问题。
据我所知,ios项目使用cocoapods,然后我尝试删除podfile.lock并再次运行pod install
但它不起作用。
我也尝试删除node_modules
文件夹并再次运行yarn install
但仍然遇到问题。
我希望构建它并且可以从 xcode 运行。现在它只能通过命令运行react-native run-ios
确保已打开"projName.workspace"
,然后选择项目转到"General" tab -> "prjtNameTests"
然后选择主机应用程序"yourproject"