简体   繁体   English

我的 androids 应用在某些设备上存在基于 Activitynotfoundexception 的崩溃。 我怎样才能再生它?

[英]My androids app have Activitynotfoundexception based crashes on some devices. How can i regenerate it?

I have an Android app released on Google Play.我有一个在 Google Play 上发布的 Android 应用程序。 It works fine but some users complains about app crashes when it's opened.它工作正常,但一些用户抱怨应用程序在打开时崩溃。 On Play console there is an %2,5 crash rate and all of them are activitynotfoundexception .在 Play 控制台上有 %2,5 的崩溃率,所有这些都是activitynotfoundexception But me or my several android user friends didn't experience any crash on real devices.但我或我的几个 android 用户朋友在真实设备上没有遇到任何崩溃。 I also tested it on several emulators from api 21 to 30 (because on crash report Android version varies) but still had no problem.我还在 api 21 到 30 的几个模拟器上对其进行了测试(因为崩溃报告 Android 版本不同)但仍然没有问题。

I have proguard enabled which can cause this exception but i think if proguard was the cause all users would experience same problem, not %2,5 of them.我启用了可能导致此异常的 proguard,但我认为如果 proguard 是导致所有用户都会遇到相同问题的原因,而不是其中的 %2,5。

My app starts with a splash screen activity, which only shows up an image and after 1 second delay calls the main activity, which is technically a login page.我的应用程序以一个启动屏幕活动开始,它只显示一个图像,并在 1 秒延迟后调用主要活动,这在技术上是一个登录页面。 Users are directed to webview activity if they click to "login via web" button there.如果用户单击此处的“通过 Web 登录”按钮,他们将被定向到 webview 活动。 On %80 percent of crash reports, it says it couldn't find the webview activity, and rest of them are abut not finding main (login) activity.在 80% 的崩溃报告中,它表示找不到 webview 活动,其中 rest 几乎找不到主要(登录)活动。 All activities are declared on manifest file.所有活动都在清单文件中声明。

An example crash report:崩溃报告示例:

android.content.ActivityNotFoundException: 
  at android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:2069)
  at android.app.Instrumentation.execStartActivity (Instrumentation.java:1717)
  at android.app.Activity.startActivityForResult (Activity.java:5250)
  at android.support.v4.app.f.startActivityForResult (BaseFragmentActivityApi16.java:3)
  at android.app.Activity.startActivityForResult (Activity.java:5208)
  at android.support.v4.app.i.startActivityForResult (FragmentActivity.java:4)
  at android.app.Activity.startActivity (Activity.java:5579)
  at android.app.Activity.startActivity (Activity.java:5547)

  **at com.myPackageName.myAppName.MainActivity.a (MainActivity.java:33)
  at com.myPackageName.myAppName.MainActivity$c.onResponse (MainActivity.java:9)**

  at okhttp3.RealCall$AsyncCall.execute (RealCall.java:5)
  at okhttp3.internal.NamedRunnable.run (NamedRunnable.java:3)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:919)

Any suggestions about where should i dig?关于我应该在哪里挖掘的任何建议? How can i regenerate this crash?我怎样才能重新生成这个崩溃? Thanks.谢谢。

The problem might be that you leak a reference to your activity, and later the activity is killed and re-created for any number of reasons.问题可能是您泄漏了对您的活动的引用,后来由于多种原因该活动被终止并重新创建。 Then the old reference to your activity is used and it causes a crash.然后使用对您的活动的旧引用,它会导致崩溃。 This fits your situation, as your app may work ok in some memory usage conditions and crash in other conditions unpredictably.这适合您的情况,因为您的应用程序可能在某些 memory 使用条件下工作正常,而在其他条件下意外崩溃。 In your stack trace I see that you have an inner class MainActivity$c which (if it is not static) has an implicit reference to your activity class.在您的堆栈跟踪中,我看到您有一个内部 class MainActivity$c(如果它不是静态的)隐式引用您的活动 class。 So if you leak a reference to MainActivity$c, you also leak a reference to MainActivity.因此,如果您泄漏了对 MainActivity$c 的引用,那么您也泄漏了对 MainActivity 的引用。 Check your code for leaks of this kind.检查您的代码是否存在此类泄漏。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在某些设备上,我的android应用在Google Play商店中不可见。 - my android app is not visible in google play store for some devices.? Android-共享首选项在某些设备上崩溃。 - Android - Shared Preferences crashes on some devices. WindowManager BadTokenException:在某些设备上崩溃我的应用程序 - WindowManager BadTokenException: Crashes My app on some devices 我的微调小部件在不同的设备上看起来有所不同。 如何定义在所有手机上看起来都一样的Spinner? - My Spinner Widgets look different on different devices. How can I define a own Spinner that looks the same on all handsets? 在某些Android设备上的ActivityNotFoundException - ActivityNotFoundException on some Android devices 我已将我的应用程序上传到 Play 商店,但有些设备没有出现 - I have upload my app into play store, but some devices not appeared 正常字体在某些设备上显示为斜体。 为什么以及如何修复? - Normal font appears italic on some devices. Why and how to fix? 几个Android设备上的相同序列号。 Adb没用。 如何更改序列号? - Same serial number on several android devices. Adb is useless. How can I change the serial number? 我无法在某些设备上启动我的Android应用 - I can't launch my Android app on some devices 我无法在android studio模拟器中甚至在手机中作为运行设备来运行该应用程序。 不幸的是,数据库程序已停止 - I wouldn't able to run the app in android studio emulator and even in my phone as running devices. the database Program is unfortunately stopped
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM