欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android Rreact Native 常見錯誤總結(jié)

 更新時間:2017年06月15日 09:25:42   投稿:lqh  
這篇文章主要介紹了Android Rreact Native 常見錯誤總結(jié)的相關(guān)資料,需要的朋友可以參考下

Android Rreact Native 常見錯誤總結(jié)

   1.invariant violation:expected a component class,got[object object]

       創(chuàng)建自定義組件首字母要大寫,否則會報錯.

    2.Module 0 is not a registered callable module.

       將gradle升級成最新版本(cd Android 進入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 調(diào)用原生控件的話,創(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ā)生原生一般是你引用了無效的組件,如果組件確實正確,看下引用的組件是否正常導(dǎo)出:(export defalut)

  6.react native  undefined is not an object (evaluating this....

          發(fā)生該錯誤的一般是忘記bind(this),只要回調(diào)函數(shù)中需要用到this的,一般都需要bind.

    7.react native - expected a component class, got [object Object]

   該錯誤可能是你引用了小寫的組件,組件首字母一定要大寫,比如<login/>應(yīng)該寫成<Login/>

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關(guān)文章

最新評論