gpt4 book ai didi

java - Android 应用程序随机崩溃(java.lang.NoClassDefFoundError)

转载 作者:行者123 更新时间:2023-11-30 01:49:43 25 4
gpt4 key购买 nike

我的应用程序不断与网络通信,并且在我第一次启动它时运行完美。但是过了一段时间,当我最小化应用程序或在不同应用程序之间切换时,然后当我打开我的应用程序时,它会崩溃。这是日志:

10-19 16:53:12.872: E/AndroidRuntime(15318): Process: com.aleph.view, PID: 15318

10-19 16:53:12.872: E/AndroidRuntime(15318): java.lang.NoClassDefFoundError: com.aleph.model.MessageTypes

10-19 16:53:12.872: E/AndroidRuntime(15318): at com.al+nuListActivity.prepareURL(MainMenuListActivity.java:435)

10-19 16:53:12.872: E/AndroidRuntime(15318): at com.aleph.view.abstractActivity.TemplateListActivity.processThread(TemplateListActivity.java:148)

10-19 16:53:12.872: E/AndroidRuntime(15318): at com.aleph.controller.MainMenuAction.ListItemClick(MainMenuAction.java:168)

10-19 16:53:12.872: E/AndroidRuntime(15318): at com.aleph.view.myTrip.MainMenuListActivity.onListItemClick(MainMenuListActivity.java:109)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.app.ListActivity$2.onItemClick(ListActivity.java:319)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.widget.AdapterView.performItemClick(AdapterView.java:300)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.widget.AbsListView.performItemClick(AbsListView.java:1186)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.widget.AbsListView$PerformClick.run(AbsListView.java:3099)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.widget.AbsListView$3.run(AbsListView.java:4046)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.os.Handler.handleCallback(Handler.java:739)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.os.Handler.dispatchMessage(Handler.java:95)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.os.Looper.loop(Looper.java:135)

10-19 16:53:12.872: E/AndroidRuntime(15318): at android.app.ActivityThread.main(ActivityThread.java:5376)

10-19 16:53:12.872: E/AndroidRuntime(15318): at java.lang.reflect.Method.invoke(Native Method) 10-19 16:53:12.872: E/AndroidRuntime(15318): at java.lang.reflect.Method.invoke(Method.java:372)

10-19 16:53:12.872:E/AndroidRuntime(15318): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)

10-19 16:53:12.872: E/AndroidRuntime(15318): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

其次是:

10-19 16:54:08.802: E/AndroidRuntime(16425): Process: com.aleph.view, PID: 16425

10-19 16:54:08.802: E/AndroidRuntime(16425): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aleph.view/com.aleph.view.myTrip.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2345)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.app.ActivityThread.access$800(ActivityThread.java:155)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.os.Handler.dispatchMessage(Handler.java:102)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.os.Looper.loop(Looper.java:135)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.app.ActivityThread.main(ActivityThread.java:5376)

10-19 16:54:08.802: E/AndroidRuntime(16425): at java.lang.reflect.Method.invoke(Native Method)

10-19 16:54:08.802: E/AndroidRuntime(16425): at java.lang.reflect.Method.invoke(Method.java:372)

10-19 16:54:08.802: E/AndroidRuntime(16425): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)

10-19 16:54:08.802: E/AndroidRuntime(16425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)

10-19 16:54:08.802: E/AndroidRuntime(16425): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference

10-19 16:54:08.802: E/AndroidRuntime(16425): at com.aleph.model.phoneHome.PhoneHomeValidator.checkMobileData(PhoneHomeValidator.java:124)

10-19 16:54:08.802: E/AndroidRuntime(16425): at com.aleph.model.phoneHome.PhoneHomeValidator.primeMobileForValidation(PhoneHomeValidator.java:54)

10-19 16:54:08.802: E/AndroidRuntime(16425): at com.aleph.view.myTrip.LoginActivity.onCreate(LoginActivity.java:70)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.app.Activity.performCreate(Activity.java:6021)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)

10-19 16:54:08.802: E/AndroidRuntime(16425): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)

10-19 16:54:08.802: E/AndroidRuntime(16425): ... 10 more

长期以来一直在努力解决这个问题。请帮忙

最佳答案

这是来自三星设备吗?我认为三星在本地代码编译器优化等方面过于激进。我使用 Splunk MINT 接收远程堆栈跟踪,我在三星设备上看到三种崩溃,大约每几千次运行就有一次:

  • 进程正在尝试以用户 -2 的身份做某事
  • 应用没有明显拥有的权限
  • 随机莫名其妙的NoClassDefFoundError

关于java - Android 应用程序随机崩溃(java.lang.NoClassDefFoundError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33245055/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com