Android上的版本React Native项目出现“应用已停止”错误

时间:2019-01-08 12:14:09

标签: android reactjs react-native

当应用正常运行时,它可以工作,但是当释放该应用时,该应用不会在手机上执行(应用已停止)。 反应本机版本: 这个package.json文件:

  * {
  "name": "project",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "@babel/runtime": "^7.1.2",
    "color": "^3.0.0",
    "native-base": "^2.8.1",
    "react": "^16.3.1",
    "react-native": "^0.55.4",
    "react-native-exit-app": "^1.0.0",
    "react-native-restart": "0.0.6",
    "react-native-send-intent": "^1.0.28",
    "react-navigation": "^1.5.12"
  },
  "devDependencies": {
    "babel-eslint": "^8.2.6",
    "babel-jest": "22.4.3",
    "babel-preset-react-native": "^4.0.0",
    "eslint": "^4.19.1",
    "eslint-plugin-react": "^7.10.0",
    "jest": "22.4.3",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  }
}*

使用的代码: react-native run-android --variant = release

$ cd android $ ./gradlew assembleRelease

1 个答案:

答案 0 :(得分:0)

我们可以对此做一些详细说明,最好是堆栈跟踪(尽管我意识到使用发行版构建可能会有些棘手)。

我会猜测您的发行版已启用“最小化”(保护混淆和可能的代码收缩)。崩溃 可能是由在此过程中重命名方法(如果通过反射使用而导致崩溃)甚至删除(再次导致崩溃)引起的。

祝你好运。如果您提供更多细节,您可能会获得更多见识。