接入热更新后检测到新版本,点击下载后直接崩溃,求大神帮忙看看



  • 这是代码:
    import Router from './Router';
    import _updateConfig from './update.json';
    import {checkUpdate, downloadUpdate, switchVersion, switchVersionLater} from "react-native-update";
    const {appKey} = _updateConfig[Platform.OS];

    export default class index extends Component {
    constructor(props) {
    super(props);
    this.state = {};
    }

    componentWillMount(){
        checkUpdate(appKey).then(info => {
            if (info.expired) {
                Alert.alert('提示', '您的应用版本已更新,请前往应用商店下载新的版本', [
                    {text: '确定', onPress: ()=>{info.downloadUrl && Linking.openURL(info.downloadUrl)}},
                ]);
            } else if (info.upToDate) {
                Alert.alert('提示', '您的应用版本已是最新.');
            } else {
                Alert.alert('提示', '检查到新的版本'+info.name+',是否下载?\n'+ info.description, [
                    {text: '是', onPress: ()=>{downloadUpdate(info).then(hash => {
                            Alert.alert('提示', '下载完毕,是否重启应用?', [
                                {text: '是', onPress: ()=>{switchVersion(hash);}},
                                {text: '否',},
                                {text: '下次启动时', onPress: ()=>{switchVersionLater(hash);}},
                            ]);
                        }).catch(err => {
                            Alert.alert('提示', '更新失败.');
                        });}},
                    {text: '否',},
                ]);
            }
    
        }).catch(err => {
            Alert.alert('提示', '更新失败.');
        });
    }
    

    这是错误信息:
    03-09 10:35:12.103 18545-18597/? E/ReactNativeJS: undefined is not a function (evaluating 'e.doUpdate(t)')
    03-09 10:35:12.112 18545-18598/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
    Process: com.text1, PID: 18545
    com.facebook.react.common.JavascriptException: undefined is not a function (evaluating 'e.doUpdate(t)'), stack:
    onPress@544:1438
    <unknown>@99:1187
    value@18:3269
    <unknown>@18:696
    value@18:2426
    invokeCallbackAndReturnFlushedQueue@18:666

                                                       at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:56)
                                                       at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:40)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:363)
                                                       at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
                                                       at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
                                                       at android.os.Handler.handleCallback(Handler.java:754)
                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)

登录后回复