日常報(bào)錯(cuò)記錄

1. Json Value’’of type NSNull cannot be cover

原因image中的uri為null

判斷image中的顯示

AsyncStorage.setItem('firebaseUser', JSON.stringify(data))

2. cannot find module‘@babel/plugin-propesd-decoraters’from‘…..’

未在ios項(xiàng)目中pod?

先npm install再pod install

3. unable to find module for eventdispatcher

需重新react-native run-ios

4.no bundle

需react-native run-ios

5. yarn start --reset-cache

Wrong version of Flow. The config specifies version ^0.45.0 but this is version 0.49.0 Could not start Flow ? ? ? server!

需? npm install flow-bin@0.45.0 -g

6. React-native-swiper組件

直接map是不會(huì)滾動(dòng)的,需要在render里用{this.renderSwiper()}用for循環(huán)遍歷出來(lái)

7.定義全局變量 在app.js里

? ? constructor(props){

? ? ? super(props);

//這里添加globel方法

global.arrData =[];

? ? }

在全局可以直接調(diào)用arrData數(shù)組 可以直接對(duì)arrData操作

8.Unable to load script.Make sure you're either running a metro server(run 'react-native start')or that?your bundle 'index.android.bundle' is packaged correctly for release.

中文翻譯:無(wú)法加載腳本。請(qǐng)確保您運(yùn)行的是Metro服務(wù)器(運(yùn)行'react-native start')或者您的軟件包'index.android.bundle'已正確打包以供發(fā)布

1. 檢查index.android.bundle這個(gè)文件是否存在? 在編輯器里全局搜了這個(gè)文件沒(méi)有找到

2. 需要在 項(xiàng)目中在android/app/src/main/創(chuàng)建文件夾assets 然后在項(xiàng)目根目錄下執(zhí)行命令

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

9.TextInput? 設(shè)置editable={false}為不可點(diǎn)擊

10.unhandled JS Exception: Requiring unknown module "49". if you are sure the module is there

更新代碼并npm install后只是reload了沒(méi)有重啟服務(wù)導(dǎo)致

重啟服務(wù)即可

11.Invariant Violation: Invariant Violation: Tried to get frame for out of range index NaN;

出現(xiàn)這種錯(cuò)誤的主要原因是ListView的數(shù)據(jù)源為空,你可以按照數(shù)據(jù)源的賦值過(guò)程查找

12.push 數(shù)組重復(fù)問(wèn)題

需要在循環(huán)內(nèi)部定義對(duì)象并push

https://blog.csdn.net/u012746918/article/details/92622420

13.去掉滾動(dòng)條

showsVerticalScrollIndicator = {false}//隱藏縱向滾動(dòng)條

14.添加延時(shí)

?setTimeout(()=> {

? ? ? ? ? ? this.setState({ isAble:true })

? ? ? ? },2000);

15. 坑了幾天的日期組件英文顯示

通過(guò)locale="Chinese”搞定了

16.Android極光分享微信上圖片不顯示的問(wèn)題 需要先把圖片下載到本地再?gòu)谋镜刈x取靜態(tài)路徑

https://community.jiguang.cn/question/322210?fs=1

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容