錯誤訊息說明
Attmepted to redefine property 'height'
style 重複定義了 height
fetch() Network Request Failed
在 ios 的 info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
React/RCTBridgeModule.h file not found
0.34版本後要求的方法 ,所以用第三方容易出錯
Older way of importing react-native header files:
#import <React/RCTBridgeModule.h>
#import <React/RCTLog.h>
New & correct way of importing react-native header files:
#import "RCTBridgeModule.h"
#import "RCTLog.h"
unable to load script from assets index.android.bundle
新版本編譯有問題
1.(in project directory) mkdir android/app/src/main/assets
2.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
3.react-native run-android
cannot read property 'string' of undefined
property 要求字串沒有定義
0.49 之前都是正常的
static propTypes = {
pagetype:React.PropTypes.string.isRequired
};
0.49後要改
因為React 沒有 proptypes , 所以要提出來使用其他 prop-types
import PropTypes from 'prop-types';
static propTypes = {
pagetype:PropTypes.string.isRequired
};
unable to load script from assets index.android.bundle
1.(in project directory) mkdir android/app/src/main/assets
2.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
3.react-native run-android