Search code examples
androidflutterdartandroid-studio

Flutter: Debugger not working, breakpoints disabled when application run in debug mode


A very strange behaviour I encountered while debugging one of my flutter project, in this very specific project I am not able to debug, if I add breakpoints in the project and start debugging the app, it will automatically disabled the breakpoints.

enter image description here

However, if I add breaking point in the main.dart file, it is working at that point :

enter image description here

But the breaking points are not working on any other file.

Things I have tried :

  • Flutter clean, Invalidate cache and restart
  • Update flutter version, earlier project was working with flutter 3.3.10, I updated it to work with flutter 3.22.2
  • Update flutter plugin used in android studio.

My other flutter projects works fine. Let me know if any other information is required from my side.

Any help would be much appreciated..

Thanks in advance


Solution

  • Check the imports, make sure all the imports have an absolute path. If your folders are named:

    screens/components

    make sure that your imports match exactly that name. If you write something like:

    import 'package:myapp/Screens/components/file.dart'
    

    it won’t work, it must be exactly

    import 'package:myapp/screens/components/file.dart'