9

So essentially, my application was working with no errors, until I restarted my computer. Now, whenever I attempt to run the application from within Android Studio, the application crashes after a few seconds (with no interaction) with the following output:

    03-08 13:57:30.175 16138-16138/com.aryangulati.ddapppt2 V/StudioProfiler: StudioProfilers agent attached.
    03-08 13:57:30.210 16138-16203/com.aryangulati.ddapppt2 V/StudioProfiler: Acquiring Application for Events
    03-08 13:57:30.367 16138-16138/com.aryangulati.ddapppt2 A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 16138 (gulati.ddapppt2), pid 16138 (gulati.ddapppt2)

Surprisingly, this error only occurs when my device is plugged into my laptop. When I opened the application directly on my phone, unplugged from the computer, it functions normally. However, whenever the device is plugged into the laptop and/or I run it from the IDE, it causes a crash. I have tried restarting Android Studio, but the same problem still occurs. Why does this happen? And what can I do to fix it?

Edit: I found this thread: Android app crashes with SIGABRT Signal 6 only while Eclipse debugging, but for some reason, I cannot find the show all ANRs option in the developer settings. Any help there would also be appreciated.

Edit 2: I have found this only occurs when attempting to use the android profiler

Aryan Gulati
  • 165
  • 3
  • 9
  • Possible duplicate of [Android app crashes with SIGABRT Signal 6 only while Eclipse debugging](https://stackoverflow.com/questions/21595778/android-app-crashes-with-sigabrt-signal-6-only-while-eclipse-debugging) – ferminx360 Mar 08 '19 at 10:17
  • Not sure if this is just me, but I cannot seem to find the "show all ANRs" option in my developer options, is it possible it was removed (android 9)? – Aryan Gulati Mar 08 '19 at 10:29
  • @AryanGulati , I think the option was renamed to "Show background ANRs"...also, when the ANR/crash dialog appears for me, it doesn't ask me if I would like to wait for the application to respond because it is already dead :( – Eric May 20 '19 at 00:49
  • related SO question: https://stackoverflow.com/questions/52940401/app-keeps-crashing-when-android-profiler-is-used – Eric May 20 '19 at 08:05

1 Answers1

1

In Android Studio 4.0 (or higher), there is a specific way to run the app with Profiler:

  1. From menu click on "Run"
  2. Profile 'app'

With this mode, app does not crash.

Pablo Alfonso
  • 2,317
  • 1
  • 18
  • 24