问题描述:使用react-native init 初始化一个react-native(下面简称RN) 项目后;运行react-native run-ios 命令的时候 报错 Print: Entry, “:CFBundleIdentifier”, Does Not Exist
电脑环境是
- mac 10.13.6
- xcode 9.4.1
- react-native 0.40.0
我的解决方法:
遇到这种情况,是因为存在报错!我直接用Xcode运行代码
react_native_book/ios/react_native_book.xcodeproj
(react_native_book是我的项目名称 )
然后build项目 发现有一个报错 Users/brady/Gits/react_native_book_v4/node_modules/react-native/React/Base/RCTJavaScriptLoader.mm 文件中有一个报错 Ordered comparison between pointer and zero (‘NSNumber *’ and ‘int’)
解决上面报错的方案就是:
if (_total > 0) {
[desc appendFormat:@" %ld%% (%@/%@)", (long)(100 * [_done integerValue] / [_total integerValue]), _done, _total];
}
修改成
if ([_total intValue] > 0) {
[desc appendFormat:@" %ld%% (%@/%@)", (long)(100 * [_done integerValue] / [_total intValue]), _done, _total];
}
就行了!