美文网首页
ReactNative常见错误

ReactNative常见错误

作者: 二斤寂寞 | 来源:发表于2019-07-23 20:24 被阅读0次

1Unable to load script from assets index.android.bundle on windows

image.png
mkdir android/app/src/main/assets
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native run-android

2 Invariant Violation: requireNativeComponent: "BVLinearGradient" was not found in the UIManager

image.png
#package.json下执行
npm install react-native-linear-gradient --save

#ios Podfile
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'

3 Invariant Violation: Tried to get frame for out of range index NaN

image.png

flatlist 数据源data数据json结构不是数组对象

4 RN的view拖拽失效

image.png

[5 Runtime is not ready for debugging!]

5.png
解决方案:
重启mac

[6 Image source size {42, 32} does not match loaded image size {21, 16}]

image.png
解决方案:
检查资源文件a
a@2x.png分辨率不是a.png的两倍,修改资源文件确保@2x是其两倍,@3x分辨率是其三倍之后,问题解决。

https://www.jianshu.com/p/57ed76e90605

相关文章

网友评论

      本文标题:ReactNative常见错误

      本文链接:https://www.haomeiwen.com/subject/tcerbqtx.html