命令: react-native run-ios
报错:Could not find iPhone X simulator
解决办法:
1、找到项目目录文件:node_modules/react-native/local-cli/runIOS/findMatchingSimulator.js
2、
if (!version.startsWith('iOS') && !version.startsWith('tvOS'))
改成:
if (!version.startsWith('com.apple.CoreSimulator.SimRuntime.iOS') && !version.startsWith('com.apple.CoreSimulator.SimRuntime.tvOS'))
3、
simulator.isAvailable !== 'YES'
改成:
if (simulator.isAvailable !== true)
报错:Print: Entry, ":CFBundleIdentifier", Does Not Exist
iOS报错: pod install
Unable to find a specification for React-Core depended upon by RNCAsyncStorage
解决办法:
在rn项目的node_modules,找到对应的 React-Core
将 s.dependency 'React-Core'
改成 s.dependency 'React/Core'
iOS运行报错:
error: Building for iOS Simulator, but the linked and embedded framework '***.framework' was built for iOS + iOS Simulator.
修改项目配置里面的Validate Workspace
为Yes,正常编译成功!
再次修改回NO,也会正常编译!(何解???)
xcode10+出现的问题
解决办法:
替换内容:
static BOOL RCTParseUnused(const char **input)
{
return RCTReadString(input, "attribute((unused))") ||
RCTReadString(input, "__attribute__((__unused__))") ||
RCTReadString(input, "__unused");
}