使用 Android 分析器时应用程序不断崩溃
Posted
技术标签:
【中文标题】使用 Android 分析器时应用程序不断崩溃【英文标题】:App keeps crashing when Android profiler is used 【发布时间】:2019-03-27 04:20:53 【问题描述】:我的应用会在需要时进行一些位置跟踪和更新数据库,该应用已经运行了 2 天,没有任何问题。现在我正在尝试使用 android Profiler (Android Studio 3.01),但是,一旦我打开它,它就会运行几秒钟,然后它开始使应用程序崩溃。有人有想法吗?
10-22 21:31:01.236 16471-16471/myproject.myfirstapp A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 16471 (ampaigns.myfirstapp), pid 16471 (ampaigns.myfirstapp)
10-22 21:31:01.358 16585-16585/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-22 21:31:01.358 16585-16585/? A/DEBUG: Build fingerprint: 'google/taimen/taimen:9/PPR2.181005.003/4984323:user/release-keys'
10-22 21:31:01.358 16585-16585/? A/DEBUG: Revision: 'rev_10'
10-22 21:31:01.358 16585-16585/? A/DEBUG: ABI: 'arm64'
10-22 21:31:01.358 16585-16585/? A/DEBUG: pid: 16471, tid: 16471, name: ampaigns.myfirstapp >>> myproject.myfirstapp <<<
10-22 21:31:01.358 16585-16585/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
10-22 21:31:01.358 16585-16585/? A/DEBUG: x0 0000000000000000 x1 0000000000004057 x2 0000000000000006 x3 0000000000000008
10-22 21:31:01.358 16585-16585/? A/DEBUG: x4 000000000000000a x5 000000000000000a x6 000000000000000a x7 000000000000000a
10-22 21:31:01.359 16585-16585/? A/DEBUG: x8 0000000000000083 x9 00000077c95b99d8 x10 fffffff87ffffbdf x11 0000000000000001
10-22 21:31:01.359 16585-16585/? A/DEBUG: x12 0000000000000064 x13 0000000000000000 x14 00000000ffffffff x15 0000007fdd2337b8
10-22 21:31:01.359 16585-16585/? A/DEBUG: x16 00000077c95f22c8 x17 00000077c95302d8 x18 0000007fdd23313a x19 0000000000004057
10-22 21:31:01.359 16585-16585/? A/DEBUG: x20 0000000000004057 x21 0000000000000083 x22 0000000004000000 x23 0000000000000000
10-22 21:31:01.359 16585-16585/? A/DEBUG: x24 000000773f7f1640 x25 0000007fdd233b38 x26 0000000000000000 x27 000000773f7f1640
10-22 21:31:01.359 16585-16585/? A/DEBUG: x28 0000007747a6d460 x29 0000007fdd233800
10-22 21:31:01.359 16585-16585/? A/DEBUG: sp 0000007fdd2337c0 lr 00000077c9524a90 pc 00000077c9524abc
10-22 21:31:01.606 16585-16585/? A/DEBUG: backtrace:
10-22 21:31:01.606 16585-16585/? A/DEBUG: #00 pc 0000000000021abc /system/lib64/libc.so (abort+124)
10-22 21:31:01.606 16585-16585/? A/DEBUG: #01 pc 0000000000066ad4 /data/data/myproject.myfirstapp/libperfa_arm64.so
10-22 21:31:01.606 16585-16585/? A/DEBUG: #02 pc 0000000000072c48 /data/data/myproject.myfirstapp/libperfa_arm64.so
10-22 21:31:01.606 16585-16585/? A/DEBUG: #03 pc 0000000000072890 /data/data/myproject.myfirstapp/libperfa_arm64.so
10-22 21:31:01.606 16585-16585/? A/DEBUG: #04 pc 0000000000052058 /data/data/myproject.myfirstapp/libperfa_arm64.so
10-22 21:31:01.607 16585-16585/? A/DEBUG: #05 pc 00000000000910b0 /system/lib64/libopenjdkjvmti.so (_ZN12openjdkjvmti11Transformer26TransformSingleClassDirectILNS_13ArtJvmtiEventE85EEE***S_12EventHandlerEPN3art6ThreadEPNS_18ArtClassDefinitionE+1864)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #06 pc 0000000000091c48 /system/lib64/libopenjdkjvmti.so (openjdkjvmti::Transformer::RetransformClasses(openjdkjvmti::ArtJvmTiEnv*, openjdkjvmti::EventHandler*, art::Runtime*, art::Thread*, int, _jclass* const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+768)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #07 pc 0000000000039f90 /system/lib64/libopenjdkjvmti.so (openjdkjvmti::JvmtiFunctions::RetransformClasses(_jvmtiEnv*, int, _jclass* const*)+192)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #08 pc 0000000000053e40 /data/data/myproject.myfirstapp/libperfa_arm64.so
10-22 21:31:01.607 16585-16585/? A/DEBUG: #09 pc 00000000004b2828 /system/lib64/libart.so (art::ti::AgentSpec::DoLoadHelper(_JNIEnv*, bool, _jobject*, int*, art::ti::LoadError*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+832)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #10 pc 00000000004b2e78 /system/lib64/libart.so (art::ti::AgentSpec::Attach(_JNIEnv*, _jobject*, int*, art::ti::LoadError*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)+120)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #11 pc 0000000000476c30 /system/lib64/libart.so (art::Runtime::AttachAgent(_JNIEnv*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, _jobject*)+1312)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #12 pc 00000000003d325c /system/lib64/libart.so (art::VMDebug_nativeAttachAgent(_JNIEnv*, _jclass*, _jstring*, _jobject*)+1908)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #13 pc 0000000000079a48 /system/framework/arm64/boot-core-libart.oat (offset 0x78000) (dalvik.system.VMDebug.nativeAttachAgent [DEDUPED]+200)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #14 pc 000000000055cc4c /system/lib64/libart.so (art_quick_invoke_static_stub+604)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #15 pc 00000000000cf760 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #16 pc 00000000002823b0 /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #17 pc 000000000027c36c /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+948)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #18 pc 000000000052d8dc /system/lib64/libart.so (MterpInvokeStatic+204)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #19 pc 000000000054f214 /system/lib64/libart.so (ExecuteMterpImpl+14612)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #20 pc 000000000018fa0c /system/framework/boot-core-libart.vdex (dalvik.system.VMDebug.attachAgent)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #21 pc 0000000000255e68 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2146680767+496)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #22 pc 000000000025b9e8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #23 pc 000000000027c350 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #24 pc 000000000052d8dc /system/lib64/libart.so (MterpInvokeStatic+204)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #25 pc 000000000054f214 /system/lib64/libart.so (ExecuteMterpImpl+14612)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #26 pc 00000000004b5f4a /system/framework/boot-framework.vdex (android.app.ActivityThread.attemptAttachAgent)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #27 pc 0000000000255e68 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2146680767+496)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #28 pc 000000000025b9e8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #29 pc 000000000027c350 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #30 pc 000000000052d8dc /system/lib64/libart.so (MterpInvokeStatic+204)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #31 pc 000000000054f214 /system/lib64/libart.so (ExecuteMterpImpl+14612)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #32 pc 00000000004b7eca /system/framework/boot-framework.vdex (android.app.ActivityThread.handleAttachAgent+18)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #33 pc 0000000000255e68 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2146680767+496)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #34 pc 000000000025b9e8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #35 pc 000000000027c350 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #36 pc 000000000052d8dc /system/lib64/libart.so (MterpInvokeStatic+204)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #37 pc 000000000054f214 /system/lib64/libart.so (ExecuteMterpImpl+14612)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #38 pc 000000000037f02e /system/framework/boot-framework.vdex (android.app.ActivityThread$H.handleMessage+222)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #39 pc 0000000000255e68 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2146680767+496)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #40 pc 000000000025b9e8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #41 pc 000000000027c350 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #42 pc 000000000052c3d8 /system/lib64/libart.so (MterpInvokeVirtual+584)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #43 pc 000000000054f094 /system/lib64/libart.so (ExecuteMterpImpl+14228)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #44 pc 0000000000ae3442 /system/framework/boot-framework.vdex (android.os.Handler.dispatchMessage+42)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #45 pc 0000000000255e68 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2146680767+496)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #46 pc 000000000025b9e8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #47 pc 000000000027c350 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
10-22 21:31:01.607 16585-16585/? A/DEBUG: #48 pc 000000000052c3d8 /system/lib64/libart.so (MterpInvokeVirtual+584)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #49 pc 000000000054f094 /system/lib64/libart.so (ExecuteMterpImpl+14228)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #50 pc 0000000000aea530 /system/framework/boot-framework.vdex (android.os.Looper.loop+404)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #51 pc 0000000000255e68 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2146680767+496)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #52 pc 000000000025b9e8 /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #53 pc 000000000027c350 /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #54 pc 000000000052d8dc /system/lib64/libart.so (MterpInvokeStatic+204)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #55 pc 000000000054f214 /system/lib64/libart.so (ExecuteMterpImpl+14612)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #56 pc 0000000000384a52 /system/framework/boot-framework.vdex (android.app.ActivityThread.main+214)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #57 pc 0000000000255e68 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2146680767+496)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #58 pc 000000000051cb18 /system/lib64/libart.so (artQuickToInterpreterBridge+1032)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #59 pc 0000000000565afc /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #60 pc 000000000055cc4c /system/lib64/libart.so (art_quick_invoke_static_stub+604)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #61 pc 00000000000cf760 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #62 pc 00000000004633b8 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #63 pc 0000000000464e10 /system/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1440)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #64 pc 00000000003f43b0 /system/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+48)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #65 pc 000000000011e6d4 /system/framework/arm64/boot.oat (offset 0x114000) (java.lang.Class.getDeclaredMethodInternal [DEDUPED]+180)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #66 pc 000000000055c988 /system/lib64/libart.so (art_quick_invoke_stub+584)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #67 pc 00000000000cf740 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #68 pc 00000000002823b0 /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #69 pc 000000000027c36c /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+948)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #70 pc 000000000052c3d8 /system/lib64/libart.so (MterpInvokeVirtual+584)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #71 pc 000000000054f094 /system/lib64/libart.so (ExecuteMterpImpl+14228)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #72 pc 0000000000c0b2f6 /system/framework/boot-framework.vdex (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #73 pc 0000000000255e68 /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.2146680767+496)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #74 pc 000000000051cb18 /system/lib64/libart.so (artQuickToInterpreterBridge+1032)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #75 pc 0000000000565afc /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #76 pc 0000000000bea920 /system/framework/arm64/boot-framework.oat (offset 0x3cd000) (com.android.internal.os.ZygoteInit.main+3088)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #77 pc 000000000055cc4c /system/lib64/libart.so (art_quick_invoke_static_stub+604)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #78 pc 00000000000cf760 /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #79 pc 00000000004633b8 /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #80 pc 0000000000463010 /system/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+416)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #81 pc 0000000000366854 /system/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+644)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #82 pc 00000000000b1bf8 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+120)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #83 pc 00000000000b4578 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+760)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #84 pc 00000000000021a0 /system/bin/app_process64 (main+1200)
10-22 21:31:01.608 16585-16585/? A/DEBUG: #85 pc 00000000000ae760 /system/lib64/libc.so (__libc_init+88)
【问题讨论】:
将 Android Studio 更新到 3.2.1 已解决问题 与 AS 3.3.1 有同样的问题 ( 在 Android 9 设备 (Pixel 2) 上运行应用程序时,我在使用 AS 3.3.1 时遇到了同样的问题,但它在 Android 7.0 (LG-G5) 上运行良好。您可以分享您的设备/模拟器详细信息吗? 我对 AS 3.3.1 和 3.3.2 都有同样的问题。在我将三星 Galaxy S8 升级到 pie (API 28) 之前,我认为它适用于 AS 3.3.1 AS3.4 和三星 Galaxy s8 一样。 【参考方案1】:signal 6 (SIGABRT), code -6 (SI_TKILL)
表示abort
是故意的。
这个问题好像是相关的:Profiler crashes in libperfa_arm64.so
【讨论】:
【参考方案2】:您的应用程序是否是一个相当大的项目,包含大量类,可能带有一些自定义类加载器逻辑?
一旦您掌握了重现崩溃的步骤,您就可以使用 logcat 之类的工具来获取更多信息。
https://developer.android.com/studio/command-line/logcat.html
【讨论】:
我可以使用 Android 9.0 (Pie) 设备在 Android Studio 4.0 中重现该问题:E/libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc A/ libc:致命信号 6(SIGABRT),tid 17635(Jit 线程池)中的代码 -6(SI_TKILL),pid 17630【参考方案3】:在 Android Studio 4.0(或更高版本)中,以下是使用 profiler 运行时避免崩溃的导航:
1. From menu click on "Run"
2. Profile 'app'
【讨论】:
太好了,这解决了。在华为设备上,我能够运行分析器 5 秒,然后就崩溃了。在三星设备上,启动分析器时应用程序完全冻结谢谢! 对我的华为 P40 Pro 没有帮助【参考方案4】:这可能是一个 android studio 配置文件错误。删除应用程序数据包根路径(data/data/pacakge_name/codecache)中的整个 codecache 目录,然后重试配置文件。
【讨论】:
这立即奏效,不再崩溃,但现在我没有高级分析器:/ 删除文件夹:adb shell "run-as <your-app-package> rm -R /data/data/<your-app-package>/code_cache"
虽然它对我不起作用(android studio 4.2.3)。奇怪的是,一旦我添加了 debuggable: true,问题就开始了,并且一旦删除就没有修复。以上是关于使用 Android 分析器时应用程序不断崩溃的主要内容,如果未能解决你的问题,请参考以下文章
AsyncTask 不断崩溃在 Android 模拟器上运行的演示应用程序