Приложение React Native 0.61.5 продолжает останавливаться после обновления с 0.61.4 - PullRequest
0 голосов
/ 24 февраля 2020

Я только что перестроил нативное приложение 0.61.5 с nodejs 12.16.0 на платформе Win10 с эмулятором Android. Моя предыдущая версия была RN 0.61.4 и работала нормально. То, что я сделал для обновления, - это инициировал проект React Native и добавил модули один за другим в новый проект. Проблема в том, что мое новое приложение останавливается после успешного запуска с react-native run-android. Вот сообщение на эмуляторе:

Вот вывод журнала. Представление было как-то отсоединено в конце:

PS C:\d\code\js\emps_fe6> npx react-native log-android
info Starting logkitty
[19:59:13] D | ReactNative ▶︎ ReactInstanceManager.ctor()

[19:59:13] D | ReactNative ▶︎ ReactInstanceManager.createReactContextInBackground()

[19:59:13] D | ReactNative ▶︎ ReactInstanceManager.recreateReactContextInBackgroundInner()

[19:59:15] D | ReactNative ▶︎ ReactInstanceManager.onJSBundleLoadedFromServer()
                           │ ReactInstanceManager.recreateReactContextInBackground()
                           └ ReactInstanceManager.runCreateReactContextOnNewThread()

[19:59:15] D | ReactNative ▶︎ ReactInstanceManager.createReactContext()

[19:59:15] D | ReactNative ▶︎ Initializing React Xplat Bridge.

[19:59:15] D | ReactNative ▶︎ Initializing React Xplat Bridge before initializeBridge

[19:59:15] D | ReactNative ▶︎ Initializing React Xplat Bridge after initializeBridge

[19:59:15] D | ReactNative ▶︎ CatalystInstanceImpl.runJSBundle()

[19:59:15] D | ReactNative ▶︎ ReactInstanceManager.attachRootViewToInstance()

[19:59:16] D | ReactNative ▶︎ ReactInstanceManager.detachViewFromInstance()

[20:00:11] D | ReactNative ▶︎ ReactInstanceManager.ctor()

[20:00:11] D | ReactNative ▶︎ ReactInstanceManager.recreateReactContextInBackgroundInner()

[20:00:12] D | ReactNative ▶︎ ReactInstanceManager.onJSBundleLoadedFromServer()

[20:00:12] D | ReactNative ▶︎ ReactInstanceManager.recreateReactContextInBackground()
                           │ ReactInstanceManager.runCreateReactContextOnNewThread()
                           └ ReactInstanceManager.createReactContext()

[20:00:12] D | ReactNative ▶︎ Initializing React Xplat Bridge.

[20:00:12] D | ReactNative ▶︎ Initializing React Xplat Bridge before initializeBridge

[20:00:12] D | ReactNative ▶︎ Initializing React Xplat Bridge after initializeBridge

[20:00:12] D | ReactNative ▶︎ CatalystInstanceImpl.runJSBundle()
                           │ ReactInstanceManager.setupReactContext()
                           └ CatalystInstanceImpl.initialize()

[20:00:12] D | ReactNative ▶︎ ReactInstanceManager.attachRootViewToInstance()

[20:00:13] D | ReactNative ▶︎ ReactInstanceManager.detachViewFromInstance()

Вот файл package.json:

{
  "name": "emps_fe615",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-community/async-storage": "^1.8.0",
    "@react-native-community/cli-platform-android": "^4.1.1",
    "@react-native-community/datetimepicker": "^2.2.2",
    "@react-native-community/masked-view": "^0.1.6",
    "moment": "^2.24.0",
    "react": "16.9.0",
    "react-native": "0.61.5",
    "react-native-confirmation-code-field": "^5.1.0",
    "react-native-device-info": "^5.5.3",
    "react-native-elements": "^1.2.7",
    "react-native-gesture-handler": "^1.6.0",
    "react-native-gifted-chat": "^0.13.0",
    "react-native-image-picker": "^2.3.0",
    "react-native-image-resizer": "^1.2.0",
    "react-native-keychain": "^4.0.5",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-modal": "^11.5.4",
    "react-native-modal-datetime-picker": "^8.3.0",
    "react-native-reanimated": "^1.7.0",
    "react-native-safe-area-context": "^0.7.3",
    "react-native-screens": "^2.0.0-beta.10",
    "react-native-segmented-control-tab": "^3.4.1",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^4.1.1",
    "react-navigation-stack": "^2.1.1",
    "react-navigation-tabs": "^2.7.0",
    "socket.io-client": "2.1.1"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^0.0.7",
    "babel-jest": "^25.1.0",
    "eslint": "^6.8.0",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.58.0",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

Я подозреваю, что это модернизированный модуль (и) зависимости, вызывающий cra sh но я еще не нашел. Сборка запуска прошла успешно, и пакет находится на 100%. Студия и эмулятор android были перезапущены, и проблема та же. Какие могут быть проблемы, вызывающие остановку приложения?

1 Ответ

0 голосов
/ 24 февраля 2020

Одна вещь, которую я заметил, это то, что для перестройки требуется установка нескольких дополнительных модулей. Одним из них является модуль react-native-screens, который требует дополнительной настройки перед использованием. После дальнейшей настройки react-native-screens приложение начинает нормально работать.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...