No modules selected. Dart support will be disabled for the project / IntelliJ - flutter

I got flutter upgarade and imported a project from git.
and I want to run this app but Dart support is disabled.
Flutter SDK path seems apllied but Dart ( on Setting > Languages & Frameworks > Dart seems not be able to be enabled.
How could I solve this situation?
enter image description here

To solve this problem, you need to set the flag to "Enable Dart support for the following modules"

I had same issue and checking both boxes would do anything, it would always reset back. My fix is:
delete the repository
clone again with terminal (don't use Studio) and set different name for poject: git clone (url) newName
And it works.

Related

How do I access the "New Module" option in Android Studio?

I'm attempting to follow these instructions to integrate the Bolt Mobile SDK into my Flutter project, where step 5a is, after opening my project in Android Studio:
Click File, select New, then select New Module.
However, I do not appear to have any such option:
Is there something I need to do to enable it? Was it moved somewhere else, or merged into another option (Import Module doesn't seem to cover it)? The Android web site confirms that it should be there, and that page was last updated 8 days ago as of this writing.
If you are trying to access the module into the main project than follow the instructions:
Move the module in your project directory.
Suppose if your module name is - library
In setting.gradle file add this lines
include ':library'
In build.gradle file, inside the dependencies block add this lines
implementation project (':library')
.........................................
Happy coding :)
Follow the instructions on image
After that you will find multiple options, go to new and then at the top you will find New Module option. From there you can create new module or you can import, do as per your requirement.
Happy coding :)
I give a solution for this issue,
Just follow my steps :
Step 1
Step 2
Step 3
Feel free to ask if any problem comes.
Happy coding :)
I think you have to check your flutter sdk set up because when you set up your flutter sdk it will be added automatically.
And If you done this.
Then check that did you add flutter plugin into android studio ? If not then follow this step.
Go to setings
Then search plugin
then search flutter into plugin
section.
Then click on install on install button into flutter plugin
Then restart your android studio
I hope this problem will be solved because this is probable solution for this problem .
Thank you .

Lefthook error: flutter command not found

I switched from GitHub Desktop to Sourcetree due to some missing feature.
On my flutter project, I installed LeftHook to execute a linter when someone commits something.
On GitHub Desktop, Lefthook works well, but when I try to commit from SourceTree, the error sh: flutter: command not found
I can't understand why. The flutter SDK path is set globally correctly (i can use flutter commands in every terminal)
Problem solved!
Seems like that Sourcetree isn't capable to access to the PATH in witch flutter is contained (the one added in the file .zshrc).
So the solution is to add the export in every hook that lefthook uses,
something like this:
#!/bin/sh
export PATH="$PATH:/Users/.../flutter/bin"
if [ "$LEFTHOOK" = "0" ]; then
...

Why `Flutter Doctor` and `New Application Project` fails in my VSCode setup?

Following these directions, like:
Install the Flutter and Dart plugins
Start VS Code.
Invoke View > Command Palette….
Type “install”, and select Extensions: Install Extensions.
Type “flutter” in the extensions search field, select Flutter in the list, and click Install. This also installs the required Dart plugin.
Validate your setup with the Flutter Doctor
Invoke View > Command Palette….
Type “doctor”, and select the Flutter: Run Flutter Doctor.
Review the output in the OUTPUT pane for any issues. Make sure to select Flutter from the dropdown in the different Output Options.
Step 3 of validate instructions results with OUTPUT:
I did install flutter, and flutter doctor in a new command shell gives result:
What am I missing here? I also try VSCode extension palette command Flutter: New Application Project and that also fails with:
Make sure that you have installed Git and that you can access it from the command line. Check your PATH. Flutter SDK directory should be present there.
If that does not work, you should try to reinstall the dart and flutter extension.
Next Step should be to reinstall flutter.
It occurred to me that my attempt to support multiple flutter versions might be going outside of the conventions supported by the Flutter extension for VSCode.
Here's what's up!... If you think you're smart like me and installed different versions of flutter in folders like c:\src\flutter\1.20.2 and c:\src\flutter\1.22.6, then you can forget it because the extension is smarter than us, and will ignore this regardless of our PATH assignment.
Copying contents of my flutter install from c:\src\flutter\1.22.6 to the parent folder c:\src\flutter resolved my issue. I need to review how to easily support different versions of flutter. Hmmm..
BTW... what I realized in retrospect is that the complaint about git is raised by the extension not finding the .git folder under the flutter folder (i.e. c:\src\flutter) that it presumed as the path to my flutter install. Well duh!! That's because I want flutter to be sourced at the versioned sub-folder (i.e. c:\src\flutter\1.22.6). Oh well.
Some scenarios I am left pondering:
How to correctly support multiple flutter installations while also benefiting from the extension (is there a way to configure this extension or my environment as a whole)?
Are my expectations to support multiple flutter installations unreasonable?
If my expectations are reasonable, and there are no known or documented way to support multiple flutter installations while also using this extension, then perhaps the extension has a bug?

Target of URI doesn't exist: 'package:validate/validate.dart'

I tried running flutter packages get. Restarted IntelliJ community but still:
Need solution in this missing imports for future different packages that will come.
open Quick Action Search Tool using cntrl+Shift+A on windows;
search for "restart dart analysis server" press it to execute, this will make dart to analyze project again.

Getting Flutter doctor to work

How do I get flutter doctor on my Windows 10 laptop to work, please?
I followed the guidelines here,
Used git to clone the flutter repository,
git clone -b alpha https://github.com/flutter/flutter.git,
Tried adding "C:\Users\<user>\flutter\bin" to my path in the Control Panel
and then in an Admin Powershell, tried executing flutter doctor.
At first, it just hung.
After googling for help, I tried deleting the contents of the
C:\Users\<user>\flutter\bin\cache folder and re-executing flutter doctor but to no avail.
Then, I tried deleting all of flutter and cloning again but flutter doctor just hung again but with, Updating flutter tool.
Tried a few different Googled PATH-adding ideas (that seems to be a complex and disputed area.)
Got a new message: Waiting for another flutter command to release the startuplock
The latest state is that flutter doctor still just hangs but without any message.
I suspect the problem lies in the new Path not being properly recognised (in the registers??)
Can anyone help please?
Well, the issue is not clear enough, but this might be solution, if your flutter doctor is stuck, it might be due to Background Intelligent Transfer Service is disabled, in order to check for yourself, do the following:
Click on the start menu, and then start typing services.
Launch the services and look for Background Intelligent Transfer Service and make sure it is running.
At this stage I believe you will find it disabled for some reason, just right click on it and go to properties and start the service, also change the startup type to automatic.
I can not think of other reasons that might prevent flutter doctor to run for the first time on a Windows machine other than that honestly.
I know this question is a little bit old. Here is a solution that worked for me. Run the Command Prompt as an admin solved the issue for me.
For Windows user check to see if the unzipped flutter folder is read only. (i.e right click the folder then properties then in the attributes section untick the readonly property then apply this change to the folder along with the sub-folders then ok and thats it. Worked for me.
Some errors I got and how I fixed it:
(ERROR 1):
[flutter] flutter doctor -v 'crumb' is not recognized as an internal or external command, operable program or batch file.
Error: Unable to find git in your PATH. exit code 1
(Fix) - Go to flutter installation folder and inside flutter/bin edit the flutter.bat file using a text editor and remove the line (20) that says:
IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%
The code should look like this on those lines:
REM If available, add location of bundled mingit to PATH
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
Save and Run flutter doctor and everything should work fine.
(ERROR 2):
flutter doctor takes too long
(Fix) - I downloaded the previous version of the sdk it worked like a charm.
(ERROR 3):
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.
(Fix):
Open Android Studio
Tools Menu, SDK Manager
In the window that comes up there are inner panels, choose SDK Tools panel
Tick Android SDK Command-line Tools
Choose Apply button near the bottom of the window
This worked.
(ERROR 4):
The term 'flutter' is not recognized as the name of a cmdlet, function, script file, or operable program.
(Fix) - Put the correct part in the env variables. I had put D:\flutter instead of D:\flutter\bin. That worked.
I got a solution that worked for me
initially i had downloaded the 2.2.5 SDK which gave the forever run error so i went back and downloaded the previous version ie 2.2.2 it worked like a charm
The Flutter SDK is installed in a protected folder and may not function correctly. Please move the SDK to a location that is user-writable without Administration permissions and restart.