Breakpoints not working with Flutter in Android Studio - flutter

I can set breakpoints, but when I run in Debug mode the breakpoint's icon change with this:
I think that the problem is the new version of Flutter plugin in Android Studio, but I'm not sure. How to fix this?
What I've tried:
flutter clean
android studio cache clean and restart

Upgrade to the latest version of the flutter plugin 65.1.3 solved my problem.
https://plugins.jetbrains.com/plugin/9212-flutter/versions

need to roll back the version of the flutter plugin to 64.1.2.
https://plugins.jetbrains.com/plugin/9212-flutter/versions

Confirmed: plug-in was one thing.
The other problem is that IntelliJ (same for Android Studio) distinguish between:
import '../../viewmodel/**m**essages
import '../../viewmodel/**M**essages
Compiling, running, Dart analysis ... everything's fine. However, breakpoints don't work!
To be more precise: some breakpoints don't work, only in some files!
Tip: If a breakpoint does not work, remove all imports in the file. Click the bulb to get suggestions - and you will see the duplicate imports.
See wrong imports
Btw.: I am on Windows. And the file system does not distinguish between upper and lower case filenames.

Faced to this issue today as well: looks like for me the solution was to update Flutter / Dart SDK and their Plugins for Android Studio.
Some users report the problem is linked to the Chrom Version >=100 due to API change, but on my side it was not working with Edge as well.
After update problem has gone

There is indeed also an issue with Chrome Version >=100. Running flutter upgrade (to flutter 2.10.5) fixed this for me as described here

Related

VS Code testing tab no longer finds tests

After upgrading from Flutter 2.5.0 to Flutter 2.5.1, the testing tab in VS Code no longer finds all the tests for any of my Flutter projects. Instead, this is all I see:
I've tried downgrading back to 2.5.0, but no luck. Obviously, I can still use just use flutter test to run all the tests, but this isn't as nice as the testing UI that was previously available. Other developers on my teams have also run into this problem. I haven't seen any posts / info about it online or in the Flutter changelogs. My VS Code version is the exact same from before this became an problem. (VS Code version: 1.60.2)
Any help would be appreciated!
This is only a temporary fix. But if you downgrade the dart extension in VS Code, then it will bring back the older testing which can find / run all the tests.
Open the extensions tab in VS Code -> gear icon -> install another version... -> 3.26.0. After it finds the version, and you select it, you'll need to restart VS Code. Then the old testing should be available.

Flutter project on android Studio 4.2.1 no database inspector, profiler and emulator window

Two months and no answer. Am I the only one having this problem?
Yesterday I downloaded and installed Android Studio Arctic Fox 2020.3.1 on my new laptop (Windows 10 64 bit, i7-8565U) and HAVE THE SAME PROBLEM AGAIN!!
Android projects I have all tools, Flutter project missing emulator window, database inspector and profiler!
Android Studio 4.2.1 on Windows 10. Latest stable Flutter version.
If I create an Android project I have all tools: database inspector, profiler and the emulator window.
If I create a Flutter project I have no database inspector, no profiler and no emulator window.
Flutter doctor gives no error.
Everything worked fine until the upgrade to 4.2.1
What's going on? Thank you
I've had this issue and been following this question from the time you posted it. Finally found a solution to it on another SO question.
Solution: Enable the Android Facet It turned out that I had to enable
the Android Facet for this project:
Go to File → Project Structure Choose Facets Press the small + Button
at the top Select Android from the list Confirm your project by
clicking the project_name and press OK
Please check out the full answer here:
https://stackoverflow.com/a/68839489/8362593
I hope it works for you too.
If it's not showing then you can do one thing go to
Help > Find action or ctrl+shift+A > Then search.
Try Windows -> Restore default (Shift+F12 by default)
And also you can specify which windows to show: In bookMark View
I think you might rather have the PATH wrong (which means: using an outdated emulator),
because the emulator now resides in directory called emulator (which wasn't always the case).
This can be easily verified:
emulator -v
emulator: Android emulator version 30.8.4.0 (build_id 7600983) (CL:N/A)
If you'd get anything less than the current version 30.8.4.0 (despite having installed version 30.8.4.0 with the SDK Manager), you'd know what the actual cause is. Once having fixed the PATH, the proper version of the emulator should become accessible / usable ...and even an upgrade to Arctic Fox should then be possible, at least while the Flutter build.gradle scripts are compatible with Gradle 7.1.1.
Your workaround in words, you probably found this out, and did not bother to document it.
It is just for the next person :-).
Start your flutter app in debug mode.
Select your android folder in flutter project.
Right click -> Flutter -> Open in Android Studio.
Do NO upgrade Gradle Plugin, when suggested.
It might break flutter build and is not needed.
Android Window:
Click Debug Icon.
Wait a bit.
Click something in your app, so your db is active.
Android Window:
Click App Inspection at bottom of android window.
Result:
The Database Inspector shows up, and you can inspect db content in android window.
-- You have to switch between windows, and yes, it is a pain in the but.
-- Flutter plugin and Android integration is lackluster since 2018, but probably very hard to keep up with all that upstream in sync :-(.
Right, basically it doesn't work. That's it. Maybe one day it will. In the meantime I'm using AS 4.1.3 so that I can get all the available tools.
Remember to set environment: sdk: ">=2.12.0 <3.0.0" to have null-safety enabled and to go to Project Structure and set an SDK otherwise you'll get the old ADB.exe file not found when starting the Emulator which means also no Profiler and a bunch of other tools.

error when using flutter with Android Studio

If you use flutter in android studio, all the Widget ls colored with yellow(some color) and some times they recommend commands. Mine worked too, but after resetting flutter sdk, it doesn't work. At first, I thought sdk was wrong, but there's nothing wrong with running code.
For example, if you make code like this,
'build' and 'ThemeData' are colored with yellow.
And if you type 'Colors.' then it recommends some colors which you can use.
However, in my android studio.. it does not works.
I also check my preferences but I can't find the reason.
Try restarting Android Studio and your computer
Also, check if dart and flutter SDKs are properly configured for the project.
If all this seems good, check if you have accidentally uninstalled Flutter or Dart plugin in Android Studio, if yes install again and restart Android Studio.
If they are already installed try reinstalling them and restart Android Studio.
I hope this fixes your problem.

The refactoring option is gone after dart last update, what can I do, I tried restarting and uninstalled Visual Studio Code but nothing happened

Click on the image description.
Worked for me on beta as well. It's a bit less cutting edge than dev so might be better for some uses.
flutter channel beta
flutter upgrade
Also found out that turning off the previewLSP setting in the VSCode Dart & Flutter extension settings turns the refactoring menu back on. There seems to be a disagreement between LSP mode and refactoring that is fixed in later versions. If you don't want to upgrade you can try turning that setting off and then restarting VSCode.
Run flutter doctor, if flutter and dart are up to date then try switching to a different flutter channel and update flutter and dart again. It worked for me recently.
Try switch to dev channel,
flutter channel dev
flutter upgrade
I sugest to re-install the flutter plugin for VSCode (wich includes dart). See if it helps.

Parameter format not correct - flutter run

Even when I run a new project in my device or emulator, during Assemble debug process a message appears in Debug Console 'Parameter Format not correct', but the app seems to run properly.
when I add 1-2 dependencies/ plugins, countless redlines occurs in Debug Console...
I don't know what is the reason and solution.
Sorry guys this happens every time you run a project build by the previous version of flutter... and this error is not a big deal... dont worry...
I have also faced the same issue. It started coming when I upgraded the flutter SDK to version 1.17.3. The easiest solution I can come up with is to downgrade the flutter SDK.
If you are using VS code then you easily switch between flutter SDKs from the bottom bar.
To add flutter SDK -
Goto file -> settings -> flutter SDK -> Add item
then you can give the path of other SDK.
If you are not using the VS code, change the path of SDK from environment variables.
If this doesn't work out, try changing the drive for SDK of flutter and android both.
Example- From D:\flutter to E:\flutter. I have not tried this but for my friend, it worked.
If none of these workes, just ignore this error. They might fix this in future upgrades.
it may be possible ,you have cloned the repo from github and trying to run on your local machine. just change the compileSdkVersion in android>app>build.gradle file, i was facing this issue and get it fixed now
android {
compileSdkVersion 30
}
I had the same issue, but it was fixed by running flutter doctor --android-licenses
I had the same issue try to change Your Environment variable path
If you're using VS Code, then you can try this process: Go to Settings -> Flutter SDK Paths -> click on Add Item. Then put the Flutter SDK location from your drive.
For example: C:\Flutter\flutter_windows_2.5.2-stable\flutter.
I hope it worked!!
Same problem, but it was fixed by running following command in terminal.
flutter doctor --android-licenses