gpt4 book ai didi

android - 我的应用程序因静默错误而关闭 (AndroidRuntime : Shutting down VM)

转载 作者:行者123 更新时间:2023-11-29 19:49:08 29 4
gpt4 key购买 nike

MyApplication 静默终止。它打印的最后一件事是来自某个函数的跟踪日志,然后 Vm 关闭而不引用我的应用程序。

这是日志 fragment

05-17 15:25:28.294  4385  4385 D MyApplication: MyFunction()
05-17 15:25:28.294 4385 4385 D AndroidRuntime: Calling main entry com.android.commands.am.Am
05-17 15:25:28.369 4400 4400 W app_process: type=1400 audit(0.0:76): avc: denied { write } for name="system@framework@boot.art" dev="dm-0" ino=149 scontext=u:r:shell:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file permissive=0
05-17 15:25:28.419 4400 4400 W main : type=1400 audit(0.0:77): avc: denied { write } for name="arm64" dev="dm-0" ino=143 scontext=u:r:shell:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=dir permissive=0
05-17 15:25:28.371 4400 4400 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
05-17 15:25:28.375 4400 4400 D AndroidRuntime: CheckJNI is OFF
05-17 15:25:28.417 4400 4400 D ICU : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
05-17 15:25:28.458 4400 4400 I Radio-JNI: register_android_hardware_Radio DONE
05-17 15:25:28.478 4385 4385 D AndroidRuntime: Shutting down VM
05-17 15:25:28.526 4400 4400 D AndroidRuntime: Calling main entry com.android.commands.am.Am
05-17 15:25:28.546 4400 4400 D AndroidRuntime: Shutting down VM

应用程序继续运行。除了通用指示符外没有明确的指示符:05-17 15:25:28.546 4400 4400 D AndroidRuntime: Shutting down VM

最佳答案

错误是由我编写的 native 代码中的 StackOverflow 引起的。

Stackoverflows 在 Android native 代码中静默关闭,与段错误相反,因此很难找到。

使用 Tracelogging/Logdebug 或使用 Android Studio 的调试器找到最后一段工作代码,您将找到错误的位置。

静默终止的指示符是:“正在关闭 VM

05-17 15:25:28.478  4385  4385 D AndroidRuntime: Shutting down VM
05-17 15:25:28.526 4400 4400 D AndroidRuntime: Calling main entry com.android.commands.am.Am
05-17 15:25:28.546 4400 4400 D AndroidRuntime: Shutting down VM

应用程序继续运行,因为代码是在它自己的进程中执行的(通过 ProcessBuilder.command())

关于android - 我的应用程序因静默错误而关闭 (AndroidRuntime : Shutting down VM),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37279976/

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