react_native 踩坑之路

Gradle sync failed: Project with path ':react-native-code-push' could not be found in project ':app'.Consult IDE log for more details (Help | Show Log)


在react natvive version:'0.42'中遇到的问题,原因是在0.27版本以上,link的命令已经更改,但大部分网上的集成code push教程都是旧的


PLUGIN INSTALLATION (ANDROID - RNPM)
  1. As of v0.27 of React Native, rnpm link has already been merged into the React Native CLI. Simply run: react-native link react-native-code-push

    If your app uses a version of React Native that is lower than v0.27, run the following:rnpm link react-native-code-push

    Note: If you don’t already have RNPM installed, you can do so by simply running npm i -g rnpm and then executing the above command.

  2. If you’re using RNPM >=1.6.0, you will be prompted for the deployment key you’d like to use. If you don’t already have it, you can retreive this value by running code-push deployment ls <appName> -k, or you can choose to ignore it (by simply hitting <ENTER>) and add it in later. To get started, we would recommend just using your Staging deployment key, so that you can test out the CodePush end-to-end.

好文====================================================================

react native codepush

react-native-art

====================================================================


原生引入rn,出现如下问题:

Error:Error converting bytecode to dex:Cause: com.android.dex.DexException: Multiple dex files define Lokhttp3/internal/ws/RealWebSocket$1;

原因是原生引入了retrofit2,rn和retrofit2都使用了okhttp3,所以引起了冲突,解决方式如下:

compile('com.facebook.react:react-native:+'){
    exclude(module: 'okhttp-ws', group: 'com.squareup.okhttp3')
}
但这里有个很奇怪的问题,我这边exclude的'okhttp-ws', 但我看了retrofit2的引用,里边是没有这个模块的,折腾了一下午没找出原因,刚看了下错误中的冲突类的源码位置,
原来已经集成在了okhttp3里边,只但rn那还是单独引入的。
 
fresco加载gif bug:rn 0.42 默认使用的 fresco 1.0.1版本,这个版本要使用gif功能是会报错的,我只有在1.3.0版本才能正常加载gif。github地址
使用codepush进行热更新后图片是显示性能问题,我这是热更新了点击切换背景图片的view,然后点击时就会出现明显的加载性能问题,图片切换会有明显的滞后感。github issues
 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值