Flutter app is not running in my Android real device - flutter

I installed Flutter with VS code as editor..
Everything is fine ..
Flutter Doctor detects that there is a connected device ..
My device is also recognised by VS code ..
][2
But when I try to test app .. there is nothing .. NOTHING -_-
No errors .. no messages .. no app .. nothing ..
HEEEEEEEEELP PLZ

Open the command line on the folder of your app and type flutter devices and check the name of your physical device on the list.
Copy the name of the device. If it was an emulator it would something like emulator-5554
Run flutter run -d emulator-5554 (having replaced it with the name of your device).
You could also try Android Studio to test if the issue is with VScode.

try these commands on command prompt or in the terminal of your vs code its maybe helped you much easily when you use these command lines on vs code
and the lines are
flutter clean
then press enter then again
flutter pub get
then again press
flutter run -d Chrome
if you want to run the app on "Chrome"
and you use the Google Chrome as you default web browser
thank you!!! ^_^
I wish that I helps you at least to use vs code better when you didn't have any emulator attached to it

Related

VScode Dart/Flutter not working out side of terminal?

All I wanted was to make a simple flutter/dart calculator in VS code... but I've been suffering tech issues for the last 2 days trying to get it working.
Right now my problem is basically VS code is unresponsive outside of the terminal I think.
Example: in terminal when I run 'flutter doctor -v' I get
running flutter doctor in terminal
As you can see everything works fine, but when I do ctrl+shift+p and run flutter doctor it never finishes loading in the bottom right, just stating 'flutter doctor -v: running...' same with when I run Flutter: New Project.
Also when I select the No Device in the bottom right of the VS code screen to choose an emulator to run it does the same thing, just loading for ever... I have no clue why. I followed about 10 youtube tutorials on how to set up VS code for flutter, after non of them worked I uninstalled and reinstalled VS code, Android Simulator, flutter, cleared settings and fresh installing each and this problem persists.
Please check you are on the latest version of VS Code and the Dart extension. This issue should've been resolved in the Dart extension version v3.38.0.
https://github.com/Dart-Code/Dart-Code/issues/3877
If you still see this in the latest version, please file an issue on GitHub for me to take a look.

flutter commands arent Running in my command prompt, when i write flutter,i waited for an hour still didnt show anything im using win 10 pro, i tryed

i formatted my pc windows 10 , i installed window 10 pro and installed java jdk v 11, also visual studio installer, vs code android studio, all possible solutions for not recognizing flutter or flutter doctor issues, my cmd is working properly but when i write flutter i wat for hours and see nothing , my path in env variables is :C:\Program Files\flutter\bin
also seen this in my vs code terminal:
vs code terminal error
pc terminal did nothing
Because: According to the Fluter document, one of the warnings is that Flutter should not be in the Program File.
enter image description here
solution: Convert Flutter Location to C:\src\flutterand also change the path in the env to C:\src\flutter\bin
For better Understanding check the Flutter Documentation

Android studio has several problems regarding Flutter

I am new in android studio and flutter and I have encountered several problems after installing them. I already went to flutter doctor and it's all checked so flutter isn't the problem. I can't start coding because of these problems:
Here the sample code made by flutter itself I can't run it has several errors and
Here I can't run any virtual device because it says that I don't have an internet connection which is not true. I cannot code if I can't run the sample dummy code.
Thanks
I think you haven't properly done the setup for Android Studio. Please check the documentation where you will get steps for proper installation.
Few things which you can check:
Flutter and Dart plugins should be installed in Android Studio
If you want to run on an emulator, you will have to download the image for it whose answer you can find in previous answers.
When you first open Android Studio, you should get an option to create a Flutter Application.
Try to reinstall android studio with stable internet connection.
i would advise you to follow below steps to download system images to create virtual device
Select sdk manager
Download a system image by selecting show package details.You can download api32 system images which is the latest for now.
Once downloaded you can see the image file while created avd.
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 like i had put D:\flutter insted of D:\flutter\bin that worked

flutter error Could not find an option named "platforms"

I'm new to learning flutter when I try to crate a new project on android studio gives me a arror message in the event section enter image description here
The MESSAGE: [Could not find an option named "platforms". Run 'flutter -h' (or 'flutter -h') for available flutter commands and options.]
And another problem is flutter doctor does not see the android studio enter image description here
1(By the way, I want to use this version of flutter, please do not give a suggestion like update.)
2(this problem did not exist before, it happened after turning my computer off and on)
And sorry for my english mistakes
Thank you.
flutter version flutter_windows_v1.12.13+hotfix.9-stable
andorid studio version: 4.1.3
Is this the answer to your question about andorid studio?
and you need to install JDK
You are using the wrong flutter SDK. Too low information in your question. Make sure that you have the right path to flutter SDK in your IDE. Check that the flutter SDK directory has the appropriate structure, all needed files and cetera. Channel and version of flutter also may have an influence on this problem.
Got this today out of nowhere. Things were going well, but suddenly when I tried to relaunch the app from fresh, for the error Could not find an option named "target"
UPDATE:
This appears to happen when I switch branches and merge while app is running/flutter is attached. If you're using VS Code,
open your launch.json
change something, I decided to change type: "dart" to type: "notdart"
save
try to debug which fails
then revert that change.
This should fix the issue.
Previous Answer/If you're not using VS Code
What worked for me was to
flutter clean
close the editor (VS Code for me)
close the emulator
give a minute for things to close down
open task manager and kill any left over processes of dart.exe flutter.exe and java.exe and adb.exe (was doing Android)
start VS Code/Android Studio and try to debug again. (when prompted I chose to cold boot the emulator as well)
This takes a while as the emulator has to cold boot and since flutter clean was run, the compilation hadto start from scratch as well.

White screen after running my flutter web application

I have searched and tried a lot of methods.
One works for me is this command flutter run -d chrome --release.
What a pity that no debug info print out.
When i run it directly by pressing button in Android studio, my website showed nothing but white screen.
I got follow message from the Console
Launching lib\main.dart on Chrome in debug mode...
Syncing files to device Chrome...
I want to run it and get debug info. Who has good ideas?
Problem finally be solved, Firstly, Press F12 when you deploy your web to your Chrome browser. Then all debug info will be printed in Chrome Console. My problem is caused by
require.js:1959 Not allowed to load local resource: file:///E:/project/flutter_afast/lib/model/builder.dart
req.load # require.js:1959
Which caused by a import of absolute path(local path E:/...) in my dart file. Change this to relative path then work that problem out.