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/react-native-viewpager@0.0.9

问题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 react-native-secharts@1.6.1 react-native-webview@2.14.3 --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问题留言帮忙解答哈!

 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值