react-native升級問題總結

問題1: react-native-collapsible---->undefined is not an object evaluating reactNative.View.propTypes

解決方案  升級 react-native-collapsible

問題2: antd-mobile-rn undefined is not an object (evaluating' react.PropTypes.bool')

解決方案  npm install @ant-design/react-native --save

問題3: react-native-keyboard-aware-scroll-view   
undefined is not an object (evaluating' react.PropTypes.bool')

解決方案  "react-native-keyboard-aware-scroll-view": "^0.9.1",  用最新

問題4: undefined is not an object (evaluating'React.PropTypes.array)

解決方案  npm i -S react-native-radio-buttons 用最新

問題5: react-native node_modules "react-native-viewpager": "^0.2.13", 初始化  
 static propTypes = {
        isShow: PropTypes.bool
    } 有問題

解決方案  做一個自己的包 npm i -S @xxxx/[email protected]

問題6: ExceptionsManager.js:82 Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)

解決方案: 看debug方法報錯信息

問題7: Unhandled JS Exception: Cannot read property 'func' of undefined
Unhandled JS Exception: Cannot read property 'bool' of undefined   

static propTypes = {
        isShow: React.PropTypes.bool
    }

解決方案  import PropTypes from 'prop-types';

  static propTypes = {
        isShow: PropTypes.bool
    }

問題8: 

Application XXX has not been registered.

Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
If this is the case, simply kill the old packager instance (e.g. close the packager terminal window) and start the packager in the correct app folder (e.g. cd into app folder and run 'npm start').

This error can also happen due to a require() error during initialization or failure to call AppRegistry.registerComponent.

解決方案  終端衝突,關閉所有終端,重啓即可。

問題9: Error: Unable to resolve module `./index.ios` from `/Users/xxx/xx/xxx/.`: The module `./index.ios` could not be found from `/Users/xxx/xx/xxxx/.`. Indeed, none of these files exist:

解決方案 appdelegate.m 修改 #ifdef DEBUG
  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"ios" withExtension:@"jsbundle"];
#endif

問題10: Unhandled JS Exception: Cannot read property 'bool' of undefined

解決方案: 回看問題7

問題11: 

Alternatively, include "# Add new pods below this line" in a Podfile where we should add
linked dependencies. 
Please file an issue here: https://github.com/react-native-community/react-native-cli/issues
error We couldn't find a target to add a CocoaPods dependency.
Make sure that you have a "target 'IMSUI' do" line in your Podfile.

Alternatively, include "# Add new pods below this line" in a Podfile where we should add
linked dependencies.. Run CLI with --verbose flag for more details.

解決方案  ###1.將RNCWebView.xcodeproj添加到項目的Libraries中,
用Xcode打開項目,在librarie右鍵點擊add Files to 項目中
###2.在Build Phases的Link Binary With Libraries中添加libRNCWebView.a文件

問題12: bundling failed: Error: Unable to resolve module `./renderChart` from `/Users/xxx/xxx/xxx/node_modules/react-native-secharts/main/dist/index.js`: The module `./renderChart` could not be found from `/Users/xxx/xxx/xxxx/node_modules/react-native-secharts/main/dist/index.js`. Indeed, none of these files exist:
  * `/Users/xxx/xxx/xxxxx/node_modules/react-native-secharts/main/dist/renderChart(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/xxxx/xxxxx/node_modules/react-native-secharts/main/dist/renderChart/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`


解決方案    npm install [email protected] [email protected] --save
react-native link react-native-webview

問題13: E/ReactNativeJS: null is not an object (evaluating 'StatusBarManager.DEFAULT_BACKGROUND_COLOR')

問題14: Native module cannot be null.

問題15: Unable to find module for EventDispatcher

問題16: WeChat API invoke returns false

問題17: Unhandled JS Exception: TypeError: TypeError: Cannot read property 'contain' of undefined

問題18: Unable to find module for EventDispatcher

問題19: TypeError: Cannot read property 'stretch' of undefined

問題20: YellowBox.js:67 Possible Unhandled Promise Rejection (id: 0):
TypeError: _reactNavigation.NavigationActions.reset is not a function

問題21: TypeError: method.bind is not a function. (In'method. bind((O,
_assertThislnitialized2.default)( this))';'method.bind' is undefined)

問題22: null is not an object (evaluating 'CustomKeyboard.install')

問題23: 

bundling failed: SyntaxError: /Users/xxxx/xxx/xxx/node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js: Unexpected token, expected ";" (22:5)

  20 | const ANNOUNCEMENT_DID_FINISH_EVENT = 'announcementDidFinish';
  21 | 
> 22 | type ChangeEventName = $Enum<{
     |      ^
  23 |   change: string,
  24 |   announcementFinished: string,
  25 | }>;

問題24:  '-[RCTSinglelineTextInputView setInputView:]: unrecognized selector sent to instance 0x7ff980171f20' was thrown while invoking install on target CustomKeyboard with params (
    223,
    safeKey
)

問題25: TypeError: TypeError: Cannot read property 'cover' of undefined

問題26: Invariant Violation: Invariant Violation: Invariant Violation: BackAndroid is deprecated and has been removed from this package. Use BackHandler instead

問題27: Loading dependency graph, done.
error: bundling failed: Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/xxxx/xxx/xxxx/node_modules/babel-preset-react-native/index.js
    at createDescriptor (/Users/xxx/xxx/xxxx/node_modules/@babel/core/lib/config/config-descriptors.js:178:11)

問題28: error: bundling failed: Error: Cannot use the decorators and decorators-legacy plugin together

問題29: bundling failed: Error: Unable to resolve module `react-native-screens` from `/Users/xxx/xxxx/xxxx/node_modules/react-navigation-stack/lib/module/vendor/views/Screens.js`: Module `react-native-screens` does not exist in the Haste module map

問題30: Showing Recent Messages
/Users/xxxx/Library/Developer/Xcode/DerivedData/xxxx Script-1CA7E17F2429DC0D00CD455A.sh: line 3: ../node_modules/react-native/packager/react-native-xcode.sh: No such file or directory

change ../node_modules/react-native/packager/react-native-xcode.sh
to ../node_modules/react-native/scripts/react-native-xcode.sh

 

 

時間問題13至29問題留言幫忙解答哈!

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章