gpt4 book ai didi

Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) on a react-native 0.63 project(不变冲突:模块AppRegistry不是React-Native 0.63项目上已注册的可调用模块(调用runApplication)

转载 作者:bug小助手 更新时间:2023-10-25 17:53:26 29 4
gpt4 key购买 nike



I've inherited a React Native project and it's been giving me headaches for weeks now.

The current problem I have is this error:

我继承了一个反应原住民项目,它已经让我头痛了几个星期。我目前遇到的问题是这个错误:



Invariant Violation: Module AppRegistry is not a registered callable module (calling run application)



The only problem is I don't know how to implement that in the codebase I've been given.

唯一的问题是,我不知道如何在我得到的代码库中实现它。


This is the index.js file I have:

这是我拥有的index.js文件:


import * as React from 'react';
import {Navigation} from 'react-native-navigation';
import {registerScreens} from './src/components/screens';
import {store} from './src/model/store';
import {Provider} from 'react-redux';

console.disableYellowBox = true;

registerScreens(Provider, store);
Navigation.events().registerAppLaunchedListener(() => {
Navigation.setRoot({
root: {
stack: {
id: 'loginStack',
options: {
topBar: {
visible: false,
},
},
children: [
{
component: {
id: 'login',
name: 'Login',
},
},
],
},
},
});
});

These are the dependencies:

以下是依赖关系:


{
"name": "AgriPrecise",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"android_release": "react-native run-android --variant=release",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/art": "^1.2.0",
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/datetimepicker": "^2.4.2",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^5.9.3",
"@react-native-community/toolbar-android": "0.1.0-rc.2",
"@rnmapbox/maps": "^10.0.13",
"@turf/area": "^6.0.1",
"@turf/boolean-point-in-polygon": "^6.0.1",
"@turf/circle": "^6.0.1",
"lodash": "^4.17.15",
"moment": "^2.27.0",
"moment-range": "^4.0.2",
"node": "^14.4.0",
"patch-package": "^6.2.2",
"postinstall-postinstall": "^2.1.0",
"pretty-format": "^26.0.1",
"react": "17.0.2",
"react-native": "0.63",
"react-native-appstore-version-checker": "^3.0.0",
"react-native-background-fetch": "^2.0.8",
"react-native-cli": "^2.0.1",
"react-native-color-picker": "^0.6.0",
"react-native-dropdown-picker": "^3.7.0",
"react-native-easy-toast": "^1.2.0",
"react-native-eject": "^0.2.0",
"react-native-elements": "^2.0.2",
"react-native-geolocation-service": "^5.0.0",
"react-native-gesture-handler": "^1.6.1",
"react-native-html-to-pdf": "^0.8.0",
"react-native-image-picker": "^2.3.1",
"react-native-indicator": "^1.2.0",
"react-native-navigation": "^6.7.5",
"react-native-netinfo": "^1.1.0",
"react-native-password-strength-meter": "0.0.5",
"react-native-photo-view": "https://github.com/alwx/react-native-photo-view",
"react-native-safe-area-context": "^3.1.8",
"react-native-screens": "^2.11.0",
"react-native-simple-radio-button": "^2.7.4",
"react-native-svg": "^9",
"react-native-table-component": "^1.2.1",
"react-native-vector-icons": "^6.6.0",
"react-native-version-number": "^0.3.6",
"react-redux": "^7.2.0",
"realm": "^6.0.4",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"rn-fetch-blob": "^0.12.0",
"turf-line-to-polygon": "^0.2.1"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jetifier": "^1.6.6",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.11.0"
},
"jest": {
"preset": "react-native"
}
}

I'd really appreciate any help. I'm ready to start crying on my keyboard at this point.

如果能有任何帮助,我将不胜感激。在这一点上,我准备开始在我的键盘上哭泣。


I tried using AppRegistry.registerComponent() in the index.js file like so but that didn't work

我尝试在index.js文件中使用AppRegistry.RegisterComponent(),但不起作用


import * as React from 'react';
import {Navigation} from 'react-native-navigation';
import {registerScreens} from './src/components/screens';
import {store} from './src/model/store';
import {Provider} from 'react-redux';
import {AppRegistry} from 'react-native';
import {name as appName} from './app.json';

console.disableYellowBox = true;

AppRegistry.registerComponent(appName, () =>
Navigation.events().registerAppLaunchedListener(() => {
Navigation.setRoot({
root: {
stack: {
id: 'loginStack',
options: {
topBar: {
visible: false,
},
},
children: [
{
component: {
id: 'login',
name: 'Login',
},
},
],
},
},
});
}));
registerScreens(Provider, store);

更多回答
优秀答案推荐
更多回答

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com