Not able to run Flutter doctor on macos - flutter

I installed flutter 3.0.5 on two macbooks, both macbooks are intel chip.
On one MacBook flutter is running fine.
On the second macbook, I am able to run flutter channel
But when I am running flutter doctor, I am getting this error
The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3
Changing the channel to beta or master also didn't help
chown the .config folder didn't help
chmod the .config folder didn't help
This error happens by either downloading the SDK and extracting it into the desktop or documents or download folder of my user. And also happens if I just install the flutter SDK using brew

Please Check The Below Permission
The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has
read/write permissions for the current user.
Read the documentation for proper installation then try again-👇
https://docs.flutter.dev/get-started/install/macos

You can do following thing.
As per your query seems to be permission issue where the flutter sdk located.
sudo chown -R <your_username> /flutter_sdk_path/
Don't forget to replace your username[the name by which you are logged in in Mackbook] and flutter the SDK path.
Once its done then close terminal and open again and run flutter doctor command.
Note : updating permission may need restart of system soemtimes.

Redownload the flutter and put it inside your user's directory or just cut that flutter SDK and paste it inside the Users/{yourUserName}/Desktop or Documents folder and map that path to the env variable and also in android studio. Make sure that android studio has enough permissions inside the MAC.

First run flutter cmd like ( use your flutter file path)
export PATH=$HOME/bin:/Users/flutter/bin:$PATH
after run this cmd
Flutter doctor

Related

Dart_LoadScriptFromKernel: The binary program does not contain 'main'. when I run flutterfire configure

I've been looking for a solution to this problem and I can't find it anywhere.
I'm trying to install Firebase and every time I do the flutterfire configure command it pops up Dart_LoadScriptFromKernel: The binary program does not contain 'main'.
I've already done the flutter Clear command, flutter upgrade, installed and uninstalled the dart and flutter plugins. flutter doctor is ok.
I moved the project folder into other place.
Both in Android Studio and in VSCode I can run the app normally.
Thanks for help!

I have installed flutter SDK but i am recieving this error

I have installed flutter SDK and extracted it in my C Drive and I even created ENVIRONMENT VARIABLES of both flutter and git but when I run command FLUTTER DOCTOR I am receiving this error can anyone help me please
Seems like a needed program called "where" is missing, but a batch file is trying to run it. That's all I know, sorry.

Flutter - completely uninstall app from emulator

Is there any way to completely uninstall an app from the Android emulator?
I want to get rid of the database file that my app uses. I have tried
flutter clean
but when I go to the Device File Explorer in the emulator, the files are still there in the app folder, and I can see the db file in the databases folder.
I am using Visual Studio Code.
Figured out, I have to run :
adb uninstall <package>

How to test my Flutter app on my phone? With vscode

Good Morning,
I am having a problem testing my Flutter applications for lack of memory. My computer only has 4GB of RAM and I can't open the emulator for lack of memory, can anyone help me how can I test the app right on my mobile phone?
You may need to configure Android toolchain (Step 6 to 12).
Install VSCode.
Install VSCode plugins flutter and dart.
Close VSCode.
Download Flutter SDK.
Unzip and Update environment path variable with "...\FlutterSDK\bin".
Download sdk-tools.
Create an folder anywhere with name "AndroidSDK" (or any other name)
Extract downloaded sdk-tools to AndroidSDK"
Open command prompt at "...\AndroidSDK\tools\bin"
Install platform-tools using the following command
sdkmanager platform-tools
Install corresponding platform and build-tools for your mobile device.
Example: If your device is Android 9 (Which is Android Pie and API level is 28), then commands are
sdkmanager platforms;android-28 (Use sdkmanager --list to see all packages available).
sdkmanager build-tools;28.0.3 (Use sdkmanager --list to see all packages available).
Update Environtment path variable with "...\AndroidSDK\platform-tools"
Now Open New Command prompt
Run Flutter doctor -v to check for any issues (You may have to accept android-licences).
flutter doctor --android-licenses
Now Open VSCode
Create Flutter project (Ctrl+Shift+p then type "Flutter: New Project")
Note*: Internet connection is required (or)
Open Existing Flutter Project folder
Connect your android device (Debugging mode should be enabled in the developer options)
You can see connected device in VSCode at bottom-right corner
Press F5 to run or use "Flutter run" command
If you have android studio installed then:
Go to C:\Users<User>\AppData\Local\Android\Sdk
Copy folders: platform, platform-tools
Past folder into flutter SDK folder.
connect your device to computer and it will automatically detected.
It worked for me.

Flutter iOS Build Error: framework not found Flutter

I am able to run the app in android studios but whenever I try in xcode I get a flutter framework not found.
upgrade your flutter by doing
flutter upgrade
and it will upgrade the engine and download necessary tools.
This will even kill flutter daemons.
And run the application again
flutter run
Make sure you open .xcworkspace (and not .xcodeproj in XCode).
Ensure you have 'Flutter.Framework' listed under "Linked Frameworks and Libraries". If not, just drag and drop it from the main project. Like below
I was facing the same error whene I try to archive in Xcode
I fixed it by
flutter upgrade
and
flutter run
I fixed this by switching to the master channel, and switching back to the stable channel. Also remember to run 'flutter upgrade' after switching.
Delete the flutter directory.
Download new flutter
Extract it and put it where you want.
Run the command export PATH="$PATH:`pwd`/flutter/bin"
if the command does not work then specify your path like bellow
export PATH="$PATH: /Users/{your user name}/Documents/src/flutter/bin"
Restart your machine and you are ready to go.
After that - inside your project's ios directory -
delete the .symlink directory
delete the Pods directory
delete the Podfile.lock file
and now run -
flutter clean
flutter packages upgrade
flutter build ios
For me nothing worked except, deleting my flutter files fully and reinstalling.
Use this flutter docs for reinstallation: Flutter Installation Link
I tried everything nothing worked except:-
Flutter upgrade
Flutter run
and boom- Build succeeded!
Please try the following steps:
Delete the flutter SDK
Download the same flutter SDK and re-install it
restart the android studio
It should be worked well.
Fixed by switching branches from beta to master