ReactNative 常见错误

  1. 升级 Xcode 后 'config.h' file not found
    解决办法
cd node_modules/react-native/third-party/glog-0.3.4
../../scripts/ios-configure-glog.sh

2.'React/RCTBundleURLProvider.h' file not found

Xcode 左侧点击跟项目目录 -> 选择右侧 Build Settings -> 选择 All & Combined -> 搜索框输入 Always Search User Paths -> 将 Always Search User Paths 设置为 Yes -> Clean -> Build
图2

3.js 中使用 parseFloat 损失精度问题

const num4 = "1.12"
const num5 = parseFloat(num4)*10000
console.log(num5)//11199.9999999
扩大一定的倍数,对结果在缩小这个倍数
 var num1=parseFloat("234432.9")*1000000000000; 
 var num2=parseFloat("0.2")*1000000000000;
 var num3=(num1-num2)/1000000000000;

4.编译React Native IOS工程时,出现错误“fatal error: 'React/RCTEventEmitter.h' file not found”

xCode menu -> Product -> Scheme -> Manage Shemes...
Double click on your application
Build tab -> clear the tick on Pallelize Build
Scheme

clear the tick on Pallelize Build
  1. Text 组件问题
  • 字体加粗后部分机器缺少字符 解决办法添加 fontFamily: 'System'
<Text style={{fontWeight: 'bold', fontFamily: 'System'}}></Text>

错误将持续更新

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Packager can't listen on port8081 You can configure the p...
    有一种再见叫青春阅读 2,701评论 0 0
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,355评论 19 139
  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom阅读 7,593评论 0 3
  • Building a WPF Media Player linked with Remote Azure Data...
    大可乐猫阅读 1,176评论 0 1
  • 如果你在一件事情上时间投入的都不够,那这件事你拿什么成果出来?! 如果需要评职称,那你的时间就要花在做项目,写论文...
    cb788cf4f7c2阅读 1,053评论 0 0