加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

React-Native踩过的那些坑

发布时间:2020-12-15 07:14:10 所属栏目:百科 来源:网络整理
导读:问题1:undefined is not an object (evaluating ‘ReactInternals.ReactCurrentOwner’) 出现这个错误让我搞了半天,刚开始以为是this指针绑定问题,最后发现不是。 解决方案: 先在项目根目录执行 npm install 然后再 npm start 问题2:No dimension set f
  • 问题1:undefined is not an object (evaluating ‘ReactInternals.ReactCurrentOwner’)

出现这个错误让我搞了半天,刚开始以为是this指针绑定问题,最后发现不是。

解决方案:

先在项目根目录执行

npm install

然后再

npm start
  • 问题2:No dimension set for key window

解决方案:

关闭远程,清空项目,然后重新运行app。Try closing terminal,deleting ios/build and run again. I had the same issue but now its working.

  • 问题3:打包好的ReactNative运行在自己X64CPU的手机上,打开RN页面直接闪退

错误:

java.lang.UnsatisfiedLinkError: dlopen failed: "xxx/libgnustl_shared.so" is 32-bit instead of 64-bit

解决方案:

1、在项目的根目录的 gradle.properties里面添加一行代码

android.useDeprecatedNdk=true.

2、在project的root目录下的build.gradle中添加如下代码。

defaultConfig { 
    ···
    ndk{ 
        abiFilters "armeabi-v7a","x86" 
    } 
    packagingOptions { 
        exclude "lib/arm64-v8a/librealm-jni.so" 
    } 
}
  • 问题4:Could not get BatchedBridge,make sure your bundle is packaged correctly

解决方案:

首先确认手机的网和电脑的网在不在同一网段。然后需要查看React Packger是否Loading Js 文件。设置Dev Setting的ip地址以及网段。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读