应用程序仅在调试模式下崩溃
Posted
技术标签:
【中文标题】应用程序仅在调试模式下崩溃【英文标题】:App crash only in debug mode 【发布时间】:2017-08-19 01:50:48 【问题描述】:我是编程新手,正在尝试制作一个 android 应用程序。最近几天我在使用调试器时真的遇到了麻烦。该应用程序在正常运行模式下工作正常。 该应用程序已连接到 Firebase,所有数据都保存在那里。如果我尝试在调试模式下以学生身份登录,应用程序会立即崩溃。如果我以教授身份登录,我会进入主页,但如果我单击下一步按钮,我将返回登录页面,并更改为运行模式。 我真的不知道问题出在哪里,但调试器和 firebase 有什么问题吗?
我不知道我应该从哪里开始查看我收到的错误消息,所以我只是发布所有内容并希望有人知道这个问题或者可以告诉我我应该在错误代码中的哪个位置寻找解决方案。谢谢!我在这里发布了一些错误:
[ 03-26 11:07:15.981 1253: 1253 W/ ]
debuggerd: resuming target 890
03-26 11:07:15.982 1574-1592/system_process I/BootReceiver: Copying /data/tombstones/tombstone_08 to DropBox (SYSTEM_TOMBSTONE)
03-26 11:07:16.068 1574-2194/system_process D/GraphicsStats: Buffer count: 5
03-26 11:07:16.073 1574-1618/system_process W/InputDispatcher: channel '3bb91ba com.example.anna.eduback2/com.example.anna.eduback2.views.Login.LoginActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
03-26 11:07:16.074 1574-1618/system_process E/InputDispatcher: channel '3bb91ba com.example.anna.eduback2/com.example.anna.eduback2.views.Login.LoginActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
03-26 11:07:16.075 1574-1618/system_process W/InputDispatcher: channel '4df46b1 com.example.anna.eduback2/com.example.anna.eduback2.views.Mains.MainActivityProfessor (server)' ~ Consumer closed input channel or an error occurred. events=0x9
03-26 11:07:16.076 1574-1618/system_process E/InputDispatcher: channel '4df46b1 com.example.anna.eduback2/com.example.anna.eduback2.views.Mains.MainActivityProfessor (server)' ~ Channel is unrecoverably broken and will be disposed!
03-26 11:07:16.077 1302-1302/? I/Zygote: Process 890 exited due to signal (6)
03-26 11:07:16.122 1574-1986/system_process W/ActivityManager: Force finishing activity com.example.anna.eduback2/.views.Subject.SubjectViewActivity
03-26 11:07:16.185 1574-2193/system_process I/WindowManager: WIN DEATH: Window4df46b1 u0 com.example.anna.eduback2/com.example.anna.eduback2.views.Mains.MainActivityProfessor
03-26 11:07:16.186 1574-2193/system_process W/InputDispatcher: Attempted to unregister already unregistered input channel '4df46b1 com.example.anna.eduback2/com.example.anna.eduback2.views.Mains.MainActivityProfessor (server)'
03-26 11:07:16.191 1574-2084/system_process I/WindowManager: WIN DEATH: Window3bb91ba u0 com.example.anna.eduback2/com.example.anna.eduback2.views.Login.LoginActivity
03-26 11:07:16.192 1574-2084/system_process W/InputDispatcher: Attempted to unregister already unregistered input channel '3bb91ba com.example.anna.eduback2/com.example.anna.eduback2.views.Login.LoginActivity (server)'
03-26 11:07:16.211 1574-1986/system_process W/ActivityManager: Exception thrown during pause
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:615)
at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:785)
at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:1141)
at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3523)
at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:3359)
at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:1855)
at com.android.server.am.AppErrors.handleAppCrashLocked(AppErrors.java:619)
at com.android.server.am.AppErrors.makeAppCrashingLocked(AppErrors.java:477)
at com.android.server.am.AppErrors.crashApplicationInner(AppErrors.java:353)
at com.android.server.am.AppErrors.crashApplication(AppErrors.java:305)
at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:13476)
at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
03-26 11:07:16.214 1574-1986/system_process I/ActivityManager: Restarting because process died: ActivityRecord57c1c35 u0 com.example.anna.eduback2/.views.Mains.MainActivityProfessor t29
03-26 11:07:16.237 1574-1986/system_process W/ActivityManager: Exception when starting activity com.example.anna.eduback2/.views.Mains.MainActivityProfessor
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:615)
at android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:884)
at com.android.server.am.ActivityStackSupervisor.realStartActivityLocked(ActivityStackSupervisor.java:1309)
at com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked(ActivityStackSupervisor.java:1408)
at com.android.server.am.ActivityStack.resumeTopActivityInnerLocked(ActivityStack.java:2548)
at com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked(ActivityStack.java:2127)
at com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked(ActivityStackSupervisor.java:1833)
at com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked(ActivityStackSupervisor.java:1823)
at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:1196)
at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3523)
at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:3359)
at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:1855)
at com.android.server.am.AppErrors.handleAppCrashLocked(AppErrors.java:619)
at com.android.server.am.AppErrors.makeAppCrashingLocked(AppErrors.java:477)
at com.android.server.am.AppErrors.crashApplicationInner(AppErrors.java:353)
at com.android.server.am.AppErrors.crashApplication(AppErrors.java:305)
at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:13476)
at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
03-26 11:07:16.237 1574-1986/system_process D/ActivityManager: cleanUpApplicationRecord -- 890
03-26 11:07:16.244 1574-1986/system_process W/ActivityManager: Force removing ActivityRecord57c1c35 u0 com.example.anna.eduback2/.views.Mains.MainActivityProfessor t29: app died, no saved state
03-26 11:07:16.269 1574-1986/system_process I/ActivityManager: Start proc 1991:com.example.anna.eduback2/u0a71 for activity com.example.anna.eduback2/.views.Mains.MainActivityProfessor
03-26 11:07:16.269 1991-1991/? I/art: Not late-enabling -Xcheck:jni (already on)
03-26 11:07:16.269 1991-1991/? W/art: Unexpected CPU variant for X86 using defaults: x86
03-26 11:07:16.270 1574-32531/system_process W/ActivityManager: Spurious death for ProcessRecorde80098 1991:com.example.anna.eduback2/u0a71, curProc for 890: null
03-26 11:07:16.270 1574-1986/system_process E/NativeCrashListener: Unable to report native crash
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.get(ArrayList.java:411)
at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:3375)
at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:1855)
at com.android.server.am.AppErrors.handleAppCrashLocked(AppErrors.java:619)
at com.android.server.am.AppErrors.makeAppCrashingLocked(AppErrors.java:477)
at com.android.server.am.AppErrors.crashApplicationInner(AppErrors.java:353)
at com.android.server.am.AppErrors.crashApplication(AppErrors.java:305)
at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:13476)
at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
【问题讨论】:
应用做什么 应用程序以登录开始,然后您进入主页,在这里您可以按下主题按钮并转到 SubjectListAcitivty(应用程序崩溃)。在主题列表页面上,它从数据库中读取教授添加的主题,并在列表视图中显示它们。您还可以将新主题添加到列表中(并将它们保存在数据库中)。这在常规运行模式下工作正常,但在调试模式下不行。当您单击主题时,我正在处理一项新活动,但无法调试它,因为我什至无法进入 SucjectListActivity。 【参考方案1】:看看这个答案:Android app crashes when launched in debug mode。
尝试从嵌套函数中删除所有断点。在菜单中转到Run -> View Breakpoints
并删除不必要的断点。
【讨论】:
虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review @JigneshAnsodariya 有问题的链接指向一个高度赞成的 *** 问题,因此不应变为无效。 在评论中添加链接以上是关于应用程序仅在调试模式下崩溃的主要内容,如果未能解决你的问题,请参考以下文章