在學習中,遇到的bug,記錄一下
1.Duplicate declaration "FontText" --重複聲明“FontText”
出現的原因:自己定義了一個text的類,使用時又在import中導入,解決方法:從import中刪除FontText,如圖
2.the<Image>componet cannot contain children.if you want to render content on top of the image ,consider using the <ImageBackground> component or absolute positioning--<圖像>不能包含組合的自視圖。如果你想呈現內容的形象,考慮使用< ImageBackground >組件
3.No bundle URL present.Make sure you're running a packager server or have included a .jsbundle file in your application bundle.
原因:運行時打開了翻牆軟件(ShadowsocksX),只要關閉就可以
4.Type error:undefined is not an object(evaluating 'style.width')
5.Super expression error must either be null or a function
注意點在於:1.導入的react-native庫的方式2.導入的js文件路徑是否正確3.React.Component是否正確
6.TypeError: Cannot read property 'split' of undefined
split:爲分割方法,增加未定義(空字符串)的情況即可
7.Invariant Violation:View config not found for name image.
View config not found for name XXXX. 一般就是XXXX寫的有問題,如應該大寫的寫成了小寫
8.使用TabBarIOS報錯react.children.only expected to receive a single react element child
9.加載圖片require(image!'tabbar_home')報錯