1.invariant violation:expected a component class,got[object object]
創(chuàng)建自定義組件首字母要大寫,否則會報錯.
2.Module 0 is not a registered callable module.
將gradle升級成最新版本(cdAndroid進入android目錄執(zhí)行:sudo ./gradlew clean)
或者通過android studio工具升級.
3.android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
該錯誤屬于安卓Native的錯誤,如果引用的Activity不存在或者已經(jīng)銷毀,再次引用就會報該錯誤,如果是react native 調用原生控件的話,創(chuàng)建控件需要引用:getCurrentActivity()
4.android.app.Application cannot be cast to com.facebook.react.ReactApplication
需要將創(chuàng)建的MainApplication在AndroidManifest.xml配置好.
5.Element type is invalid: expected a string (for built-in components) or a class/function but got: object
發(fā)生原生一般是你引用了無效的組件,如果組件確實正確,看下引用的組件是否正常導出:(export defalut)
6.react native ?undefined is not an object (evaluating this....
發(fā)生該錯誤的一般是忘記bind(this),只要回調函數(shù)中需要用到this的,一般都需要bind.
7.react native - expected a component class, got [object Object]
該錯誤可能是你引用了小寫的組件,組件首字母一定要大寫,比如<image>應該寫成<Image>
8.通過網(wǎng)絡獲取的圖片,設置其resizeMode一定要設置高度和寬度
9,CMD+R刷新無效

release模式下,調試無效,在路徑、變量名、文件名等地方不要使用中文,例如圖片名,設置為中文的話調試時候是不顯示的
或者是沒有設置鍵盤輸入:
