React Native Built App 意外关闭

React Native Built App is closing unexpectedly

好的,过去两天我一直在挣扎,就是这样。我正在使用 React Native CLI 并使用以下软件包开发我的第一个 React Native android 应用程序:

"dependencies": {
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@react-navigation/drawer": "^6.3.1",
    "@react-navigation/material-bottom-tabs": "^6.1.1",
    "@react-navigation/material-top-tabs": "^6.1.1",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/stack": "^6.1.1",
    "react": "17.0.2",
    "react-native": "0.67.3",
    "react-native-gesture-handler": "^2.3.2",
    "react-native-immersive": "^2.0.0",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-material-textinput": "^1.3.0",
    "react-native-pager-view": "^5.4.15",
    "react-native-paper": "^4.11.2",
    "react-native-reanimated": "^2.4.1",
    "react-native-safe-area-context": "^4.2.1",
    "react-native-screens": "^3.13.1",
    "react-native-svg": "^12.3.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-vector-icons": "^9.1.0"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "babel-jest": "^26.6.3",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.66.2",
    "react-native-svg-transformer": "^1.0.0",
    "react-test-renderer": "17.0.2"
  },

在开发模式下,该应用程序运行良好且流畅。我正在开发应用程序,没有任何错误。但是,当我将用于生产的应用程序构建到 aabapk 文件中时,问题就出现了。如果我 运行 该应用程序,无论是通过 npx react-native run-android --variant=release 还是在我的物理设备上安装该应用程序,该应用程序都会在打开后立即关闭。这是 GitHub Repo Link

注意:我正在使用最新的 Android Studio 和所有最新版本的依赖项在 Windows 10 中开发应用程序。 预览: 生产模式应用

预览: 应用开发模式

请使用 LogCat 运行ning 运行 模拟器中的应用程序并检查那里的错误消息。这应该给出一些指示,像这样它可以是任何东西。如果 logcat 在您的 android 工作室中没有自动 运行 您可以打开一个终端并 运行:

adb logcat

问题出在我的 android/app/build.gradle 文件中。我更改了以下值:

def enableProguardInReleaseBuilds = false

def enableSeparateBuildPerCPUArchitecture = false

universalApk 错误

如果我保持这些不变,构建将完美顺利地进行。谁能描述一下原因吗?