I've been developing a native application (C++ with an android wrapper) and have been successfully debugging it using Android Studio on two devices via USB: a portable POS with android 7.1.2 and a smartphone with 5.1, both armeabi-v7a.
Suddenly, i can't debug the smartphone anymore but the POS works fine.
When i click "debug", the app is installed but AS hangs at "Starting LLDB Server".
If i click run (or start the app on the smartphone) and then attach to process, the app freezes mid-start (it's uncompressing assets) and again AS hangs at "Starting LLDB Server" (by "hangs" i mean it won't advance, AS itself doesn't freeze). The log shows:
05-20 10:50:47.294 18671-18671/com.my.app I/System.out: waiting for debugger to settle...
05-20 10:50:47.498 18671-18671/com.my.app I/System.out: debugger has settled (1386)
05-20 10:50:47.559 18671-18671/com.my.app D/Proxy: setHttpRequestCheckHandler
If i let the app start normally and wait a few seconds before attaching the debugger seems to briefly connect but then dies. The app keeps on working, but without a debug session:
05-20 11:30:51.980 13436-13447/com.my.app I/art: Debugger is active
05-20 11:30:55.765 13436-13447/? W/art: Debugger attempted to resume all threads without having suspended them all before.
05-20 11:30:55.769 13436-13447/? I/art: Debugger is no longer active
If, when stalled, i try stopping all, it'll just stall on "waiting for debugger response".
I've also updated AS from 202.7660.26.42.7327048 to .7351085, same.
These didn't help:
Neither did backtracking any code changes of the last few days (which were minor and at the lib level anyway).
Is there some cache i can clean, some place i can look into? The logs aren't that enlightening.
This solved it, i.e., delete/create the launch profile in Edit configurations. Odd as i constantly recompile the app with different filenames (appending timestamps). Then again the android:name
is always the same.
I assume Studio keeps tabs somewhere relating to the devices it connects to, but i couldn't find where after a cursory grep.