Open Errichamonda opened 5 years ago
Does debugging work in the samples, but not your your own app?
If it is just your own app, have you happened to modify the main activity for Android? If for instance you modify the call to FlutterMain.ensureInitializationComplete in your Activity, see 1, to not pass the "--start-paused" Dart VM flag, then debugging won't work.
If this isn't it, the next step would be to go look in your IntelliJ logs to see if something is suspect.
The debug works on other project. In the MainActivity.java there is nothing except the usual super.onCreate and GeneratedPluginRegistrant.registerWith(this);
By the way the debugging stopped working in that particular project when I upgraded the flutter plugin from 29. to 30.
The debug seems to work only on the first subfolder of 'lib'. Going deeper it seems like the debugger can't see the breakpoints.
@Errichamonda, if you hot reload or restart your app, are breakpoints hit then? Have you modified the native code of the app, or just Flutter/Dart code?
Does this also repro if you create a new (default) Flutter project?
Thanks in advance for the answers!
With flutter clean, hot reload or restart it doesn't hit breakpoints. I've modified only the Flutter Code. Nothing on Manifest, Gradle Settings or other Android folder.
With other project, like the default one that Android Studio creates, the breakpoints works. Only in this application. Probably because the file is nested inside folders.
Probably because the file is nested inside folders.
Ah! We may be having path issues. Is the app something you can share with us, or a minimal repro that has the same project structure?
Hi, I've recreated the project with the minimum files to reproduce the problem. https://github.com/Errichamonda/DebuggerTest I've added a breakpoint to the line 17 of lib/ui/main/gallery/main.dart
Thanks for the repro case!
I cloned it, added in some necessary iOS files, and opened it in IntelliJ (from the cli, via idea .
).
I was able to set and hit breakpoints (in order around line 19 of the above file, and in the setState closure). I'm not sure what's going on in your case, but you may try re-creating the project and see if that helps.
Oh well, I see now that GitHub removed something from the code, I tried with the breakpoint at line 13
OK, that breakpoint worked for me as well.
Hi @Errichamonda! Did you find any solution for this issue? I having the same problems where the breakpoints are not being hit. With other flutter projects it works fine. Is this only project that I can't debug
Hello, Please give me any solution, My breakpoint is not hit in VS code and Android studio.
@spagni @VyasPrachi Sorry, the problem disappeared after some times and after I changed the project structure to have less subfolder. Probably it's a folder/file name problem.
Hi, thank you @Errichamonda . I had the same problem and it seems so, that it is realy a naming problem.
I had the class MarkdownSplitter inside the following path:
'package:developer_guide/widgets/MarkdownWidget/MarkdownSplitter.dart'
Yes, the name of the folder was "MarkdownWidget" and the filename "MarkdownSplitter.dart".
I wasn't able to debug it via IntelliJ, it only worked via the DevTools webpage.
After changing the folder and file names to the following, the debugging is working via IntelliJ.
'package:developer_guide/widgets/markdown_widget/markdown_splitter.dart'
My flutter doctor: `[√] Flutter (Channel beta, v1.12.13+hotfix.6, on Microsoft Windows [Version 10.0.18362.592], locale de-DE) [√] Android toolchain - develop for Android devices (Android SDK version 28.0.3) [√] Android Studio (version 3.4) [√] IntelliJ IDEA Ultimate Edition (version 2019.3) [!] VS Code (version 1.38.1) X Flutter extension not installed; install from https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [√] Connected device (1 available)
! Doctor found issues in 1 category.`
Build: AI-192.7142.36.36.6241897, 202002270544,
AI-192.7142.36.36.6241897, JRE 1.8.0_212-release-1586-b04x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 1920x1080
AS: 3.6.1; Kotlin plugin: 1.3.61; Android Gradle Plugin: 3.6.1; Gradle: 5.6.4; NDK: from local.properties: (not specified), latest from SDK: 21.0.6113669; LLDB: LLDB 3.1 (revision: 3.1.4508709); CMake: from local.properties: (not specified), latest from SDK: 3.10.2, from PATH: (not found)
IMPORTANT: Please read https://developer.android.com/studio/report-bugs.html carefully and supply all required information.
Hi, I am facing a probable bug in Android Studio with debugger in Flutter Projects. I have flutter project running with multiple flavors. Flavors are configured in Run configurations and they are running accordingly.
Scenario and readings:
Waiting for a connection from Flutter on Android SDK built for x86 64...
Could not find an option named "flavor".
Run 'flutter -h' (or 'flutter
In any of the scenario, Android Studio cannot attach the debugger in the Device where App is already running. For the note: Debugger is running accordingly when App is directly run from Debug Option(Shift + F9) (instead of Run Option - Shift + F10).
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale en-US)
• Flutter version 1.12.13+hotfix.8 at D:\flutter_sdk
• Framework revision 0b8abb4724 (5 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at D:\android_sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-R, build-tools 29.0.3
• ANDROID_HOME = D:\android_sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.43.1)
• VS Code at C:\Users\Developer\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.8.1
[√] Connected device (1 available)
• Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 10 (API 29) (emulator)
• No issues found!
@krupalbhardiya I have the same problem, do you discovered any solution?
@rodolfoizidoro no solution yet.
I'm also experiencing this in VSCode.
This is still happening on plugin 53.1.5
and intellij 2020.3.2
, it works for iOS but not for android.
Still happens to me
Same issue on all projects on Android and Web. On web breakpoint mark converts from red round to white stop signal.
Facing same issue on web and android
Still the same issue on Android studio and vscode on the latest Flutter version
Steps to Reproduce
I've already opened a issue on Flutter GitHub but they weren't very useful. When I try to lauch my application in debug mode, it seems like lauching normally. The applicaion skips all the breakpoints without any error and the application doesn't wait for debugger.
Version info
Flutter doctor:
Also Flutter Plugin version: 30.0.1