I am seeing debug statements in the console but the debugger does not stop on any breakpoints. I tried clearing all breakpoints and adding them back in. Not sure how this can happen but it is.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
if you have added some
build type
inbuild.gradle
check to havedebuggable true
Have you set the debuggable flag in the AndroidManifest? If you miss that, do so by adding android:debuggable="true" in the application tag. It should look like that in the end:
For Android Studio:
Mute Breakpoints
is enabled by mistake. The icon looks like this:For Eclipse:
In my case, the app created a service with a different process with
android:process=":service"
in the AndroidManifest. So I was setting breakpoints in the service process code while the debugger is automatically attached to the main app process. Pretty stupid of me but it might help someone else.You attach to the service process with
Run > Attach Debugger To Android Process
and choose the service process. You might need to addandroid.os.Debug.waitForDebugger();
to your service process code if you can't attach in time manually.As far as I know, there's no way to automatically tell Android Studio or IntelliJ to attach to a different process before running.