5

In Android Studio, I want to debug only my code, but step in to keep taking into dependency library. I see question , also , but they don't solve the problem. I could not find a way to not debug into message_codecs.dart, message_codecs.dart or method_channel_firebase_auth.dart (firebase_auth_platform_interface-1.1.2). I also looked that I can disable or enable all exception , but that is what I don't want.

I simply don't want to step in to these system( dependencies) library. Please let me know if there is any solution.

ufo
  • 674
  • 2
  • 12
  • 35

4 Answers4

1
  1. Go to VS Code user settings. On mac you get to VS Code settings by clicking CMD + , 2A. Then you search for debugSdkLibraries and dart.debugExternalLibraries and make sure they are unchecked.

enter image description here

enter image description here

2B. Or you can edit your settings in JSON file by adding this:

"dart.debugSdkLibraries": false,
"dart.debugExternalLibraries": false,

E.g. here is my full settings file: https://gist.github.com/tomasbaran/cd0ba7cadec4466356d1dc0faa14f1e2

Tomas Baran
  • 1,570
  • 2
  • 20
  • 37
  • 1
    Where? How? I have no clue... – ufo Sep 30 '21 at 14:12
  • I just updated my answer to be clearer. I hope it helps. Cheers! – Tomas Baran Sep 30 '21 at 18:26
  • Thank you, I've upvoted your answer, altought the question was about Android Studio (as visible in the tag). I've now edited the title so it is clearer now. – ufo Oct 04 '21 at 06:39
  • 1
    Aah. I didn't notice the part about the Android Studio. I suspect there should be a similar settings in Android Studio. Thank you very much for your upvote. I truly appreciate it. You are awesome! – Tomas Baran Oct 04 '21 at 11:49
1
  1. Right click on a Breakpoint.
  2. Click on "More"
  3. Uncheck "Dart Exception Breakpoint" checkbox

Added screenshot below for reference.

https://i.stack.imgur.com/GdMnp.png

Tanuj
  • 11
  • 3
-1

When you're debugging and the code on the next line will go into something that you didn't write, Step-Over instead of Step-Into.

Step-Over will execute until the call stack is in the same state and the line you were on has finished execution.

loganrussell48
  • 1,656
  • 3
  • 15
  • 23
  • Can you explain why downvote? If you don't want to "step into" some piece of code, use "step over". If errors are occurring in the 3rd party dependency, it's either because the input to the dependency is bad, the setup/initialization for the dependency is bad, this particular version of the dependency doesn't play well with a different dependency that you have, or the version of the dependency you're using is currently broken. If you step into code you don't want to be in, you can also use the "step out" feature. – loganrussell48 Feb 05 '20 at 18:10
  • 1
    step over still goes to external files. Actually I've never understood the difference btw step into & step over since both go to the framework flutter files, so I'm not sure how different they are in reality. – Tomas Baran Aug 28 '21 at 16:12
  • Thanks for the answer but the problem is not what step-into or step-out is etc. These buttons literally does nothing different when debugging Flutter code. It does not matter which one you press :) There are similar questions still no answer for years. – Suat Özkaya Jun 23 '22 at 07:13
-1

In vscode you can configure it with "Dart: Debug External Libraries" enter image description here

Peter
  • 33
  • 7