1.react-native ListView的屬性flexWrap為wrap不起作用解決之道
2.React Native 0.32以下版本Xcode8報(bào)錯(cuò)解決辦法
2.1 'RCTRootView.h' file not found
- cd到這個(gè)項(xiàng)目中,執(zhí)行
npm install react-native
- 此項(xiàng)目中還有其他依賴,執(zhí)行
npm install
死宣,即可添加所有依賴
如果運(yùn)行還有錯(cuò)誤非剃,請(qǐng)參考以下
2.2 RCTSRWEBSOCKET.M報(bào)錯(cuò)
Ignoring return value of function declared with warn_unused_result attribute
這個(gè)報(bào)錯(cuò)在此文件中有兩處,代碼
SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
修改為
(void)SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key);
2.3 RCTSCROLLVIEW.M 報(bào)錯(cuò)
Use of undeclared identifier '_refreshControl'; did you mean 'refreshControl'?
@implementation RCTCustomScrollView { __weak UIView *_dockedHeaderView; RCTRefreshControl *_refreshControl; // 加入此行 }
重新打開(kāi)項(xiàng)目運(yùn)行
3.React Native iOS 之Could not connect to development server
將項(xiàng)目中的
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
改為本地IP
jsCodeLocation = [NSURL URLWithString:@"http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true"];
PS:127.0.0.1為本地的IP
reason:做本地局域網(wǎng)開(kāi)發(fā)環(huán)境刚梭,大部分都會(huì)做服務(wù)器映射處理,localhost 被指向特定的IP 而不是本機(jī)的127.0.0.1, 就會(huì)出現(xiàn)這樣的問(wèn)題堪唐。
4.項(xiàng)目開(kāi)始運(yùn)行報(bào)錯(cuò)
原因一:
先前運(yùn)行過(guò)其它的React-Native項(xiàng)目。
解決辦法:
退出終端程序翎蹈,重新運(yùn)行項(xiàng)目即可
原因二:
AppDelegate.m文件中
index.iOS.js文件中
兩個(gè)文件中MyProject字段設(shè)置不一樣淮菠。
解決辦法:
將字段設(shè)為一樣的字符即可。