Whether the Deffered component in flutter reduces the app bundle size for play store upload?.
As the document saying
Flutter has the capability to build apps that can download additional
Dart code and assets at runtime. This allows apps to reduce install
apk size and download features and assets when needed by the user.
But the base apk will contain flutter lib. that will be around 9+ MB.
Related
Its starting app size is 17 MB. When developing the app, It's increasing the size from 17MB.
How to reduce the size of flutter given app (First project)
I used this method to get android app
flutter build apk --build-name=0.1 --build-number=2
According to the Official documentation of Flutter, they have various steps to analyze which part of your code is exactly taking much more space than needed.
They have a proper guide on that, to take you through analyzing the source code, testing the app size, and giving you the information of which file or dependency is taking more size and how much it is taking.
If you don't want to go through it, here are some common things by which it can reduce your app size.
Remove unused resources
Minimize resources imported from libraries
Compress PNG and JPEG files
Here's the official documentation if you want to read it.
Documentation Link
you can try the following
Compress PNG and JPEG files
reduce the use of container and replace them with SizedBox and Cards
Minimize resource imported from libraries
Remove unused resources
the fewer the screens the better
also you can split the apks while building it using this command
**flutter build apk --target-platform android-arm,android-arm64 --split-per-abi
**
and always
I recently added mlkit in my app for smile detection and then .abb size increased from 48mb to 185mb. How can i reduce this size...
Are you using a flutter plugin or a direct ML Kit dependency. You could try use app bundle to include only one arch in your app, or use dynamic feature to download the feature. If you could depends on Google Play Service, you could use the unbundled version which is only hundreds of KB in size: https://developers.google.com/ml-kit/vision/face-detection/android
Please refer to https://developers.google.com/ml-kit/tips/reduce-app-size to reduce your size of the android app. Also, 48MiB to 185MiB doesn't sounds right. The native android sdk is about ~20MiB even without any of the above optimization.
In my flutter app, I need an asset just for the first start of the app and want to delete it afterwards. Is that possible?
I'm primarily using flutter for Android, so a platform specific answer would also be appreciated, if it's not possible to do with Dart Code.
It's impossible currently.
The rootBundle contains the resources that were packaged with the
application when it was built. To add resources to the rootBundle for
your application, add them to the assets subsection of the flutter
section of your application's pubspec.yaml manifest.
It's packaged with the app on build time, and it can't be modified.
Why don't you enable to read your assets anytime and handle the possibility of displaying in your code by condition.
I am relatively new to flutter and app development. I noticed that whenever a new flutter project is created, there are many default plugins pre-loaded into the project and this makes the app take up a minimum of 80 Mb. Could i get a summary on which plugins are actually important in order to run any app in general?
Flutter provides almost all the basic things like themeing, icons, routing etc out of the box.
You can have any other package if you need more functionality like fetching data from internet and so on.
The important thing is the size you see is the debug build which is large as it contains the VM for hot reload to work at such speed. When you build the release version it is the minimum version which goes for about <5Mb on bare-bone app.
Currently my debug app stands at around 80mb on emulator but the release version is < 6mb.
So to answer your question,
it is the debug size,not the final version
Flutter requires no extra plugin for an offline app with basic functionality. Core components + testing is provided out of the box.
Nothing useless is shipped by default,
NOTE: there is a section called dev_dependencies in pubspec.yaml which means the packages listed under this won't go into the release build and are only for development purpose.
I was trying to build an android apk using Intel XDK.I just want to know if there is an option to set the splash screen, icons, application title in some build properties file rather than choosing it everytime you build the apk.
In the current build system the build menu is the only way to specify these assets. However, each time you build your app it will reuse the assets you provided initially. If you create a new project you'll have to provide them again.
In the Cordova build option you provide these assets by specifying them in an intelxdk.config.xml file. This is probably closer to what you are looking for. In the next major release we'll also be providing a way to provide those directly in the XDK, rather than on-line, but only for Cordova build options. However, there will be more flexibility in how you provide those assets, which will be easier to explain once that version of the XDK "hits the streets."
Sorry, but company policy does not allow me to provide a release date. All I can say is that it will be coming in the near future.