Android Studio terminates app during debug if stopped at a breakpoint for more than several seconds
Asked Answered
Y

1

10

I have an Oppo A53s running Android 11. When I set a breakpoint in the initial activity (login page), once the breakpoint is hit the app will terminate after five seconds of inactivity. This problem doesn't occur on the emulated devices or on my other test device, a Samsung Tab A, also running Android 11. Also,once the app starts another activity, I can stay on a breakpoint in the new activity indefinitely.

Here's the portion of the app manifest showing the definition of the login activity:

    <activity
        android:name=".LoginActivity"
        android:theme="@style/SplashTheme"
        android:screenOrientation="locked"
        android:exported="true">
       <intent-filter>
           <action android:name="android.intent.action.MAIN" />
           <category android:name="android.intent.category.LAUNCHER" />
       </intent-filter>
    </activity>

And here's the relevant lines from logcat:

2022-02-09 16:12:38.811 11786-11786/com.uomini.meecha D/OplusInputMethodUtil: init DEBUG to false, update DEBUG_IME to false
2022-02-09 16:12:39.381 11786-12103/com.uomini.meecha V/FA: Connection attempt already in progress
2022-02-09 16:12:44.018 11786-11800/com.uomini.meecha I/m.uomini.meech: Thread[2,tid=11800,WaitingInMainSignalCatcherLoop,Thread*=0xb4000079bc426000,peer=0x12ec0000,"Signal Catcher"]: reacting to signal 3
2022-02-09 16:12:44.018 11786-11800/com.uomini.meecha I/m.uomini.meech: 
2022-02-09 16:12:44.190 11786-11800/com.uomini.meecha I/m.uomini.meech: Wrote stack traces to tombstoned

Same thing happens on my other apps, so I don't think it's an app problem, especially since it only occurs on the Oppo.

Yevette answered 9/2, 2022 at 15:17 Comment(1)
No solution yet. I contacted Oppo support and they were useless. Told me to bring the phone in to one of their stores. In the Philippines. Yeah, right. So now I use another device for debug testing and only use the Oppo when I want to run my apps. However, I did also file a bug against Android Studio (bug #218397066).Yevette
S
4

Had the same issue on Realme GT. It works fine after turning off "Verify apps over USB" and "Verify bytecode of debuggable apps" in developer options of the device.

Submicroscopic answered 18/12, 2023 at 18:42 Comment(2)
I wish I could award you some reputation points. Your solution totally fixed a problem I had been having since February 2022. Well done and thanks a lot!Yevette
I almost gave up on this thing myself and bought another phone:D The solution is not perfect though and sometimes it still crashes, but it is better than not being able to use the device at allSubmicroscopic

© 2022 - 2024 — McMap. All rights reserved.