无法使用 -variant=release 运行我的应用程序,立即崩溃 [英] Can't run my app with -variant=release, crashes immediately

查看:94
本文介绍了无法使用 -variant=release 运行我的应用程序,立即崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个相当小的应用程序,使用简单的组件(例如 Flatlist、Image 和 Searchbar)有 3 个屏幕.它运行良好,除非我尝试使用 --variant=release 进行测试.

I'm creating a fairly small app, 3 screens using simple components such as Flatlist, Image and Searchbar. It runs nicely except when I try to test with --variant=release.

我完成了签名过程,并且我可以确认这部分工作正常,因为我已经在 Google Beta 中成功部署了我的应用程序(只是看到来自 Google 的测试报告显示我的应用程序在所有模拟器上都崩溃了).

I did the signing process and I can confirm this part works as I've deployed my app in Google Beta successfully (only to see the test report from Google showing my app crashed on all simulators).

我还尝试了我在 Google 上能找到的所有内容(清理、重置缓存、将所有内容升级到最新版本,甚至从头开始我的项目,然后将我的 src 文件夹复制粘贴到其中).

I've also tried everything I could find on Google (cleaning, reset cache, upgrading everything to last version, even starting my project from scratch and just copy pasting my src folder in).

这是我的 package.json,以防我看不到我的依赖项有问题:

Here's my package.json, in case something's wrong with my dependencies I couldn't see :

  "dependencies": {
    "@react-native-community/async-storage": "^1.6.2",
    "axios": "^0.19.0",
    "he": "^1.2.0",
    "moment": "^2.24.0",
    "react": "16.9.0",
    "react-native": "0.61.2",
    "react-native-device-info": "^4.0.1",
    "react-native-elements": "^1.2.6",
    "react-native-extended-stylesheet": "^0.12.0",
    "react-native-fast-image": "^7.0.2",
    "react-native-gallery-swiper": "^1.23.1",
    "react-native-gesture-handler": "^1.4.1",
    "react-native-reanimated": "^1.3.0",
    "react-native-vector-icons": "^6.6.0",
    "react-navigation": "^4.0.10",
    "react-navigation-drawer": "^2.2.2",
    "react-navigation-hooks": "^1.1.0",
    "react-navigation-stack": "^1.9.4",
    "react-redux": "^7.1.1",
    "redux": "^4.0.4",
    "redux-devtools-extension": "^2.13.8",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.6.4",
    "@babel/runtime": "^7.6.3",
    "@react-native-community/eslint-config": "^0.0.5",
    "babel-jest": "^24.9.0",
    "eslint": "^6.5.1",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.56.0",
    "react-test-renderer": "16.9.0"
  },
  "jest": {
    "preset": "react-native"
  }

这是我启动应用程序时的 logcat 文件的摘录:

Here's an extract of the logcat file when I start the app :

10-22 10:40:51.265 32285 32285 E elevenelevenap: Not starting debugger since process cannot load the jdwp agent.
10-22 10:40:51.340  1817  1921 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
10-22 10:40:51.341  1817  1921 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
10-22 10:40:51.822  1817  1817 E Layer   : [Surface(name=AppWindowToken{b55b6c0 token=Token{4cb0043 ActivityRecord{43741f2 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t5}}})/@0x2af8cf8 - animation-leash#0] No local sync point found
10-22 10:40:51.823  1817  1817 E Layer   : [Surface(name=AppWindowToken{b55b6c0 token=Token{4cb0043 ActivityRecord{43741f2 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t5}}})/@0x2af8cf8 - animation-leash#0] No local sync point found
10-22 10:40:51.823  1817  1817 E Layer   : [Surface(name=AppWindowToken{470f541 token=Token{8241428 ActivityRecord{21c524b u0 com.elevenelevenapp/.MainActivity t95}}})/@0xf0a643b - animation-leash#0] No local sync point found
10-22 10:40:51.823  1817  1817 E Layer   : [Surface(name=AppWindowToken{470f541 token=Token{8241428 ActivityRecord{21c524b u0 com.elevenelevenapp/.MainActivity t95}}})/@0xf0a643b - animation-leash#0] No local sync point found
10-22 10:40:51.840  1817  1817 E Layer   : [Surface(name=AppWindowToken{b55b6c0 token=Token{4cb0043 ActivityRecord{43741f2 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t5}}})/@0x2af8cf8 - animation-leash#0] No local sync point found
10-22 10:40:51.840  1817  1817 E Layer   : [Surface(name=AppWindowToken{470f541 token=Token{8241428 ActivityRecord{21c524b u0 com.elevenelevenapp/.MainActivity t95}}})/@0xf0a643b - animation-leash#0] No local sync point found
10-22 10:40:52.105 32285 32310 E ReactNativeJS: TypeError: undefined is not an object (evaluating 'm.hot.accept')
10-22 10:40:52.107 32285 32310 E ReactNativeJS: Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
10-22 10:40:52.109 32285 32311 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
10-22 10:40:52.109 32285 32311 E AndroidRuntime: Process: com.elevenelevenapp, PID: 32285
10-22 10:40:52.109 32285 32311 E AndroidRuntime: com.facebook.react.common.JavascriptException: TypeError: undefined is not an object (evaluating 'm.hot.accept'), stack:
10-22 10:40:52.109 32285 32311 E AndroidRuntime: <unknown>@383:349
10-22 10:40:52.109 32285 32311 E AndroidRuntime: v@2:1474
10-22 10:40:52.109 32285 32311 E AndroidRuntime: <unknown>@6:58
10-22 10:40:52.109 32285 32311 E AndroidRuntime: v@2:1474
10-22 10:40:52.109 32285 32311 E AndroidRuntime: d@2:876
10-22 10:40:52.109 32285 32311 E AndroidRuntime: global code@968:4
10-22 10:40:52.109 32285 32311 E AndroidRuntime: 
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(ExceptionsManagerModule.java:71)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:371)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:150)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:883)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:100)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:26)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:214)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:225)
10-22 10:40:52.109 32285 32311 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:919)
10-22 10:40:52.174  1799  2450 E GnssHAL_GnssInterface: gnssSvStatusCb: a: input svInfo.flags is 8
10-22 10:40:52.174  1799  2450 E GnssHAL_GnssInterface: gnssSvStatusCb: b: input svInfo.flags is 8
10-22 10:40:52.197  2038  2142 E InputDispatcher: channel '1977922 com.elevenelevenapp/com.elevenelevenapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

正如你所看到的,它显示了一些错误,但到目前为止我无法将它们追溯到我可以做的事情,因此向你们寻求帮助,我很绝望.

As you can see it shows a few errors but so far I couldn't trace them back to something I could work on, hence asking you guys some help, I'm quite desperate.

谢谢

推荐答案

也许你需要应用程序在AndroidManifest.xml的标签里面添加android:usesCleartextTraffic="true".

Maybe you need application to add inside the tag of AndroidManifest.xml android:usesCleartextTraffic="true".

像这样:

    <application
    ...
      android:usesCleartextTraffic="true"
      ...
    >

   ...
</application>

让我知道这是否有效,尽管我现在有点晚了

Let me know if this works for, though im kind of late right now

这篇关于无法使用 -variant=release 运行我的应用程序,立即崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆