react-native 常见报错处理

1.java.io.IOException: Could not delete path 'F:\xxxx\android\app\build\intermediates\transforms\dex\debug\folders\1000'.

解决:(权限问题导致)以管理员身份运行控制台再运行react-native run-android,如果还报错手动删除'F:\xxxx\android\app'目录下的build文件夹。
2.FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-device-info:prepareComAndroidSupportAppcompatV72301Library'.
> Could not expand ZIP 'D:\SDK\extras\android\m2repository\com\android\support\appcompat-v7\23.0.1\appcompat-v7-23.0.1.aar'.
解决:此问题还1类似还是权限问题 ,手动删除“F:\xxxxx\node_modules\react-native-device-info\android”目录下的build文件夹。(注意:以上是以react-native-device-info组件为例,如果是其它组件报类似问题 目录为: \node_modules\组件名\android )
3.npm i 或npm install 界面卡死 ,如下:
[..................] - loadIdealTree:loadAllDepsIntoIdealTree: sill install loadIdealTree

解决:

方法一:源问题 ,npm换源参考:https://blog.csdn.net/wozaixiaoximen/article/details/50448893

方法二:如果还是不行考虑升级node 版本,或者降价node 版本 ,我的解决办法是:把node8.11.3降到node8.11.2

方法三:npm 命令换成 yarn 命令,yarn命令参考 https://blog.csdn.net/mjzhang1993/article/details/70092902

4.蚂蚁UI组件antd-mobile报错:

error: bundling failed: Error: Unable to resolve module `react-dom` from `F:\yewugorn\node_modules\antd-mobile\lib\modal\alert.js`: Module does not exist in the module map

解决:重新安装antd-mobile组件 yarn add antd-mobile 默认安装最高版本 ;

如果还没有好就安装指定版本实施yarn add antd-mobile@2.1.8  安装指定版本。

如果安装过程卡住了或者安装失败请参考3换源 换命令再试试。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值