Breakpoint does not belong to any class

Viewed 3233

In a some cases android studio stopped debugging process.

I have restart ide, emulator, but problem still appeared

enter image description here

5 Answers

Try to clean the project and rebuild. It worked for me in Android Studio. You can find cleaning the project in Build tab.

What worked for me was to right-click the file in the Project tree and select Mark as Plain Text then Mark as Kotlin from the same menu.

Th first of all check app level build.gradle file

1. In a buildTypes debuggable property must be true

debug / release {
            minifyEnabled false
            debuggable true
            manifestPlaceholders = [crashlyticsEnabled: false]
        }

2. If the problem not solves restart adb server adb kill-server then adb start-server

Only after restarting adb server helps to fix problem

Open Command promt and go to android sdk>platform-tools>

execute adb kill-server then adb start-server

Just had the same problem. It was somehow caused by kotlinx.serialization, possibly combined with data binding (as it also misbehaved in a strange way).

Basically having any class annotated with @Serializable in a file caused the Breakpoint does not belong to any class error for any line within that file.

Removing the class and doing the holy combo of android studio troubleshooting ( rm -rf ~/.gradle, find $PROJECT_ROOT -name build |xargs rm -rf and "File / invalidate&restart" ) solved the problem for a particular file.

The problem is likely caused by some of the dependencies having slightly incompatible versions, and to my knowledge there is no reliable way of figuring out the working combination of the said version.

Related