flutter: split-debug-info Don't work for web project? - flutter

when I use the command on windows build everything is ok:
flutter build windows --split-debug-info=mySoftware/symbols
When I use the same command to web build i get the message:
flutter build web--split-debug-info=profept_client/symbols
**`Could not find an option named "split-debug-info".`**
why I can't run this command o flutter web?

Related

Exception: Gradle build failed to produce an .apk file,the tool couldn't find it

I used flutter flavor and I can't run but it run from terminal using this type of command:
flutter run --flavor prod -t lib/main_prod.dart
When I run using android studio run button then show this exception, which I write below:
Exception: Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\Users\ranak\StudioProjects\bachelor_flat\build, but the tool couldn't find it.
here is my app-build.gradle file
Click on the dropdown near the run button and select Edit Configurations, then write --flavor prod -t lib/main_prod.dart or anything you want in the Additional run args text field.

Flutter APK size it's greater than 150mb

i'm having some problems while compiling my flutter app for Android.. I've only 3 assets and a couple packages added, but when I try to compile, I got this:
√ Built build\app\outputs\flutter-apk\app-release.apk (158.3MB).
Any idea?
Flutter build log (running flutter build apk)
PS C:\\Users\\Admin\\Desktop\\Fictix\\Don't Touch This\\app\\dtt_app\> flutter build apk
Building with sound null safety
First of all, you can try clearing the cache via terminal.
flutter clean
This command will delete few temporary folders, specially "build/", ".dart_tools/" and ".packages/".
You can also run the following code from the terminal before the build phase of your application.
flutter build appbundle --target-platform android-arm,android-arm64
Of course, it is not a 100% method, but it can work in reducing your application size.
You can follow the steps below to clear it by Android Studio.
Tools > Flutter > Flutter Clean
Make your app with no sound null safety
From Terminal Run This Command
flutter build apk --split-per-abi --no-sound-null-safety
or
flutter build apk --release --no-sound-null-safety
If your problem still persists
// #2.9 in the top remove the parameter from Const app_name();
Run --no-sound-null-safety from terminal
Edit your Configure File and write in Additional run args:- --no-sound-null-safety

How I can select which main file I must build in flutter during a release of a desktop application?

In flutter a made a linux application. Is consumes an endoint that varies depending the environment I need to build for. For each environment I have a different main file:
For production I have a main-prod.dart
For staging I have a main-staging.dart
For local development I have a main-dev.dart
All files are located into `./lib/ folder with the rest of source code
During building for desktop application via:
flutter build linux or
flutter build windows or
flutter build macos
During run I can provide via -t parameter for example for local development I run:
flutter run -t ./lib/main-dev.dart
But how on Chirst's sake I can do the same for buidling as well?
In you case you can build your application via:
flutter ^device^ -t ^main_file^
Where ^device^ are one of the following:
windows
linux
macos
And the ^main_file^ is the one you use during flutter run` in your case you have theese commands to select from:
environment
file
windows
linux
macos
production
main-prod.dart
flutter build windows -t ./lib/main-prod.dart
flutter build linux -t ./lib/main-prod.dart
flutter build macos -t ./lib/main-prod.dart
development
main-dev.dart
flutter build windows -t ./lib/main-dev.dart
flutter build linux -t ./lib/main-dev.dart
flutter build macos -t ./lib/main-dev.dart
staging
main-staging.dart
flutter build windows -t ./lib/main-staging.dart
flutter build linux -t ./lib/main-staging.dart
flutter build macos -t ./lib/main-staging.dart

How to add mac os support to a flutter package project?

I have tried running the terminal command:
flutter config --enable-macos-desktop
but it gives me error:
The "--platforms" argument is not supported in package template
for an existing project just run
flutter create --platforms=macos .
See also here some official docs from the flutter website:
https://docs.flutter.dev/development/platform-integration/desktop#add-desktop-support-to-an-existing-flutter-app
I have found work around:
copy mac os folder from a new natural flutter project(non-package):
open terminal & run:
cd example/macos
3.run:
pod install
then
flutter run

how to build apk create old version app in Flutter

I am trying to build my release app in Flutter and when I run:
flutter run
everything works fine in debugging and test mode. But when I was trying to build a release app with:
flutter build apk
it creates an old first-release app of mine. That I created before and I try to reset the computer reset android and everything but not work what can I do to reset it and clear the cache?
I'm trying almost to delete and reset everything but they don't work.
What command that I have to run to fix it and create new version release apk
The solution is easy.
Just run flutter clean and run flutter build apk after that and it generates the updated app apk.
If you want to install it directly just run flutter install after the build command.
To all the beginners If you wish to release an apk of a flutter app just do:
flutter run --release
(and make sure to connect your device to a phone)
steps to ensure your phone is connected:
1. enable usb debugging mode in your phone
2.click on version number of your phone in system settings to enter into developer mode
3. change the phone mode to transferring file mode
After you run the command
go to build->apps->output->apk
run these command
flutter clean
and after that
flutter build apk --release
Run this command for making a bundle.
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
If flutter clean and flutter build apk also generates apk with old version code in your pubspec.yaml change the version like this version: 1.0.2+2
Before + it is your version name and after + sign it is your version code
NOTE: Your new version number should be in the place of 2. Or you can use different format such as 1.2+2
You can run flutter clean Then run flutter build apk --split-per-abi to split the apk. It will build three apks and you can find them in build/app/outputs/flutter-apk/
Can be done easily by Android Studio