Flutter project debug is stopping in my Redmi note 9 phone - flutter

Launching lib\main.dart on M2003J15SC in debug mode...
lib\main.dart:1
Plugin project :firebase_core_web not found. Please update settings.gradle.
Invalid depfile: D:\Kampus\Alternative Internship\E-Butler FLutter\history-ebutler-main\.dart_tool\flutter_build\8db1b350320c9cfb508a70518c727e07\kernel_snapshot.d
Parameter format not correct -
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Error waiting for a debug connection: The log reader stopped unexpectedly
Error launching application on M2003J15SC.
Exited (sigterm)
when i press f5 on my vscode the build is success but in my phone only view white screen and then it exited

Just switch off the Turn on MIUI Optimization in your Developer options then run your app.
For some other fixes checkout this.

Your app is installed even if your phone stays on white screen, you can see that it worked by closing and reopening the app from your phone.
This Issue happens on most Xiaomi...Redmi note 10 pro as well this is only when it comes to flutter, if you launch project from root/android it will work fine,
If you use command line flutter run it will also work but you will not get input back from command line after install only difference app is launching
At the moment this is the only worked around

Make sure that your app meets the following requirements:
Targets API level 19 (KitKat) or higher Uses Android 4.4 or higher
https://firebase.google.com/docs/flutter/setup?platform=android
in some android devices not receiving firbase base responce because of its versions and api level

flutter clean, restart your devices, reconnect your devices to your pc and run again, this solution worked for me.

Related

Flutter app stopped working on emulator/simulator (Windows 10 and MacOS)

My flutter project runs on real devices with F5 or with
flutter run --release
on real devices connected to the PC. It also worked on emulators (Windows 10) and simulators (macOS) but it stopped, getting an endless loading screen right after splash screen. On iOS i got this message in the logs:
PET daemon has launched
Failed to initialize PET service. Exiting...
Failed to initialize the tracker
Anyone an idea?
Try these three one by one:
1- flutter clean , flutter doctor (then resolve if there are any errors)
2- Search for dart.flutterAdditionalArgs in your vs code settings.
and remove args against it.
3- go to Android Studio , Uninstall all the sdk tools you have installed ,then reinstall it
I found the issue. It was the internet connection. Tried another one and it works.

W/FlutterActivityAndFragmentDelegate(27114): A splash screen was provided to Flutter, but this is deprecated

I've created a new app using the command pallet in vs Code, and I'm having many issues using it.
The inspector doesn't work - I get a message in the inspect window, stating that the inspector is not available for the application.
the application crashes a lot, and I have to wait a long time for rebuilding.
I get the following message in the debug console:
Launching lib\main.dart on sdk gphone x86 in debug mode...
lib\main.dart:1 √ Built build\app\outputs\flutter-apk\app-debug.apk.
W/FlutterActivityAndFragmentDelegate(27114): A splash screen was
provided to Flutter, but this is deprecated. See
flutter.dev/go/android-splash-migration for migration steps.
Connecting to VM Service at ws://127.0.0.1:60885/Gjga6R7ZZ-o=/ws
I/Choreographer(27114): Skipped 39 frames! The application may be
doing too much work on its main thread.
I have a feeling that there's something wrong with my environment.
windows 10
vs code 1.60.2
fluter 2.5.2
thanks in advance

Got the "Error launching application on" after flutter run

I am flowing the official tutorial to install flutter and run the default app on my iPhone Device. After I execute the flutter run, the app is installed and launched on my iPhone but the logs show the bellow error. How do I solve it?
Launching lib/main.dart on My iPhone 6 in debug mode...
Automatically signing iOS for device deployment using specified development team
in Xcode project: XXXXXXXXXX
Running Xcode build...
└─Compiling, linking, and signing... 50.2s
Xcode builds done. 90.1s
Installing and launching... 41.1s
Error launching the application on My iPhone 6. <-- Error Here
It happens that there are some process needed to Flutter plugin correctly run on physical devices. I struggled with that and finally found that the processes idevicesyslog and iproxy were being silently blocked by MacOS.
You may have noticed already a message liked this:
or a similar one for idevicesyslog.
Once I went to System Preferences -> Security & Privacy in General tab and allowed this apps, everything works. Note that this screen shows only the last app that you tried to run. So I'd recommend that you run flutter app with preferences opened so you can (hopefully) see the messages appearing and click allow.
MacOS may warn you one more time about the file being downloaded from the internet. Just click open and you're good.
The error do not show again after reboot the iPhone.
Same error -- Running fine through Xcode, when I ran with flutter CLI, the app would open, but the terminal log output would crash with the error as in the post.
I ran flutter update and simultaneously turned iPhone off and back on. After doing that, the below popup appeared (on mac).
I believe after the install finished, I ran the below (which I ran several times before updating flutter and installing the popup):
flutter clean
rm -rf ios/Pods
flutter pub get
cd ios && pod install && cd ..
run the flutter app using flutter run from command line, then the MacBook will ask for permission to open the app and app runs,
(lldb) warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance.
Error launching application on device-XXXXX.
Building & Replace with a newest version ios-deploy solved problems list aboved. Flutter SDK bundled a pre-built command ios-deploy in __PATH_TO_YOUR_Flutter_SDK_/bin/cache/artifacts/ios-deploy/, just replace it.
Please reference to: Flutter Error launching application on device issue .

First Flutter App stuck at “Running Gradle task 'assembleDebug'… ” in Llnux Mint

I'm getting the following error while running my first flutter app in the terminal
Launching lib/main.dart on vivo 1802 in debug mode...
Running Gradle task 'assembleDebug'...
(This is taking an unexpectedly long time.)
I already tried downloading the gradle distribution separately and copy pasting it in my project's gradle wrapper and restarting android studio but it still doesn't resolve the issue.
I'm using Linux Mint 19.
Make sure you have an internet connection.When running an app for the first time, gradle needs to download some additional content
Check your connection to your virtual phone or your phone well. Make sure it doesn't disconnect while you are running the app
Before starting this building process, make sure:
USB debugging is enabled on your phone,
No app is currently running (and you are on your home screen),
While running your app for the first time on a phone, your phone will get a pop-up asking you to allow the installation of apps via USB.
Click 'allow' on it.
Not clicking 'allow' or simply ignoring it will make it seem like the build process is never-ending.

Attempting to connect to browser instance.. (Flutter Web)

I'm trying to run my first flutter code on the web. I followed setup instructions provided in Building a web application with Flutter and created a very simple app, that's only supposed to display a navigation bar. Now as I'm running my application for the first time on "Chrome (web)" device, it won't connect to the browser. It's been almost 20 minutes and it's still telling me "Attempting to connect to browser instance".
> flutter run -d chrome
Launching lib\main.dart on Chrome in debug mode...
Building application for the web... 1215.1s
Attempting to connect to browser instance..
(This is taking an unexpectedly long time.)
Can anyone guide me on how to fix this?
In my case, I couldn't disable the virus guard. So I used the server mode.
flutter run -d web-server
Launching lib\main.dart on Web Server in debug mode...
Building application for the web... 8.8s
lib\main.dart is being served at http://localhost:57598/
Then go to the URL shown.
The same thing happened to me, I disabled the anti virus and it worked
It's mostly nothing to do with Flutter but, it's either because you have logged in your computer in safe mode. In my case the shift key was stuck and I had no idea I was in safe mode.
Or else You need to check your firewall, go to System Preferences > Security and Privacy > Firewall --click the lock below and enter your system password -- and then click firewall option -- In there add your editor to allow internet connection for android studio Or VS Code.
I experienced the something similar, chrome opens but never showed the web app (just white screen). In my case it had to do with the interaction of flutter and riverpod.
If you are using riverpod 1.0.0 and flutter 2.5.3 you need to update flutter to 2.8.0 or 2.8.1 (see this issue: https://github.com/rrousselGit/river_pod/issues/889)