Flutter gives "FlutterFirebaseAnalyticsPlugin.java uses unchecked or unsafe operations" error when I try to run without debugging - flutter

When I try running my app without debugging. The app gives me the following error and proceeds with the installation(I'm using my phone via USB Debugging to test my app).
Launching lib\main.dart on vivo 1901 in debug mode...
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_analytics-9.1.10\android\src\main\java\io\flutter\plugins\firebase\analytics\FlutterFirebaseAnalyticsPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
And when I enter my registered details(I have already created an account on my app) on the login page and click login , it gives me an authentication error.

The error is caused due to outdated packages in your flutter project.
To solve the errors, do the following :
Step 1: Run the command flutter pub outdated in the terminal of your development environment. This command will find and display the list of packages that can be updated.
Step 2: Run the command flutter pub upgrade in the terminal of your development environment. This command will update the outdated packages.

Related

Flutter Null Safety issue

This application is not configured to build on the web.
To add web support to a project, run flutter create ..
Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
package:flutter_speed_dial
For solutions, see https://dart.dev/go/unsound-null-safety
Unhandled exception:
You will need at least version 3.0.0 of that package to have null safety.
Given that they are at version 5.0.0 right now, you should probably update your packages every once in a while.
If you want to run without latest version you need to Update the Configuration File,
Edit Configuration
Then,
Add --no-sound-null-safety in Additional run args.
Add Command in Additional run args
Then, Click Apply and Run the app.
Edited:
you will need to latest version and if you want to run without latest version you need to run this command
$ flutter run --no-sound-null-safety

How do you compile a flutter application?

I'm seeing that I can introduce a compilation error in my dart code but flutter build ios will still successfully run. If I flutter run -d [my-simulator] the compile error will immediately be presented in a red screen on the simulator but I can't currently easily do this in a CI type check.
Is there are cli command I can run to ensure that all of the dart code is free of compile errors?
You can run dart analyze or flutter analyze commands.
More info

Can't run flutter project due to error VERBOSE.dart error, isolate error

When I try to run my flutter-project code on the iOS simulator in VS code, I get the following error on the console:
Launching lib/main.dart on iPhone 11 Pro in debug mode...
lib/main.dart:1
Xcode build done. 24.4s
[VERBOSE-2:shell.cc(103)] Dart Error: Can't load Kernel binary: Invalid SDK hash.
[VERBOSE-2:dart_isolate.cc(171)] Could not prepare isolate.
[VERBOSE-2:runtime_controller.cc(415)] Could not create root isolate.
[VERBOSE-2:shell.cc(588)] Could not launch engine with configuration.
Thanks in advance.
Hi!
In my case, the error was caused by the forced shutdown of the IDE.
After manually selecting the libraries, I identified the one that was causing the problem, updated the project without it, and updated the project again with it.
With that the problem was solved.
Hope I have helped, if yes, please flag.
Could you delete the bin/cache folder, then run app
Open terminal and run: $ flutter channel beta
"it will install beta version, once installation is done, try it!"
"In case you willing to change the beta version to stable version you can use the following:"
$ flutter channel stable

Flutter crash on release apk installed on devices / Emulator

Could you guys please help me with the problems I currently have?
I'm trying to follow the steps of how to release apk android from: https://flutter.dev/docs/deployment/android, The program which I tried to release is only the NewFlutterApplication which created from template of Flutter
The problem is: Have been followed all the steps, still I can't run the release apk which i build from flutter
The Error which I got:
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install E:\FlutterProject\flutter_app_1\build\app\outputs\apk\app.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
Install failed
The things that I have tried:
Tried from this site Flutter release apk is not installing on device, but there is no hope
Tried from this site Can't build release APK for flutter, but still no hope
Tried using the flutter run --release in the real device, it's directly crash and return stopped working
Tried using the flutter build apk && flutter install, it's not running and give the error from top error
Tried using flutter run -v it don't give any error and run smoothly and the debug it's still run smoothly, only the release APK is the problem which can't be run
UPD: This answer is outdated, Flutter now supports x86/x64
You can't run release build on emulator, because currently flutter doesn't support x86 release binaries
See this issue, and put thumb up reaction on it to increase priority:
https://github.com/flutter/flutter/issues/9253
This issue also affects devices that use Intel Atom and some Chromebooks, but don't worry, they will be excluded from supported devices by Google Play automatically
INSTALL_FAILED_NO_MATCHING_ABIS is when you are trying to install an app that has native libraries and it doesn't have a native library for your cpu architecture. For example if you compiled an app for armv7 and are trying to install it on an emulator that uses the Intel architecture instead it will not work.

After uninstall app on device flutter run not work

I'm using vs code for building my flutter app.
But after uninstall debug app on my device, 'flutter run' command not working properly and stop in installing status.
Please help me.
Thanks.
Launching lib/main.dart on RNE L21 in debug mode...
Initializing gradle... ۱۱٫۷s
Resolving dependencies... ۱۴٫۹s
Gradle task 'assembleDebug'...
Gradle task 'assembleDebug'... Done ۱۰۱٫۷s
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk... ۶٫۱s
It seems like when you uninstall the flutter application, though it is no longer available on the phone It is not deleted properly(Only in the flutter case). Therefore to fix this. you can run adb and uninstall from the package. Here is a step-by-step procedure.
If you are in windows:
Step 1. Open your SDK path in command prompt
eg.
C:\Users\kharag\AppData\Local\Android\Sdk\platform-tools
Step 2. Search your app package name from the flutter app (It will be in AndroidManifest.xml)
eg.
com.mycodingchannel.icttapp
Step 3. Now uninstall your app by running the command:
adb uninstall com.mycodingchannel.icttapp
That's all, Now run your app and it should work. Thanks
Had the same problem, copied .apk file on device and installed it from there, after that debugger worked without any issues.
Once you see Built/..... in termial. The apk has been created. Now if the installing fails/takes long time. Go to [app folder\app\outputs\apk]
Copy the app.apk/debug.apk any other file to your device and install it.
Now once you re-run it will work fine.
If that doesn't work flutter clean+flutter pub get. Follow the above step.