I'm developing an Android app using Xamarin latest version and Visual Studio latest version aiming Android SDK 8.0. The app is in Beta track (no release yet). I've been publishing updates of my app for 2 months using Google Play console, but something weird happened on my last update, because download size of my app growed from 14.16 MB to 29.80 MB and I haven't done anything different in my last update.
My app apk has always been 28 - 29 MB on disk (.apk size) and download size 14 MB aprox. In my last update I haven't done anything particulary big, just changed code logic and added 4 new resources (pngs total size: 43KB), no new dlls o references, no new componentes. If I use Android Studio apk analyzer on my last apk update, it says my download size should be 13,4 MB, but it seems that Google Play console does not want to reduce download size any more.
Android Studio shows download size should be 13,4 MB, but download size is actually 29 MB:
Pls your help. Thanks.
I updated Visual Studio from version 15.7.1 to 15.7.3
Visual Studio 15.7.1 to 15.7.3 = Xamarin.Android 8.3.0.19 to 8.3.3.2, consult releases.xamarin.com for details.
So the Mono runtime shared library got updated, thus the basically the whole apk is being downloaded again.
Have you tried Linking your app on release ?
Xamarin.Android applications use a linker to reduce the size of the application. The linker employes static analysis of your application to determine which assemblies are actually used, which types are actually used, and which members are actually used.
Used correctly it can cut your app size in half.(I normally only do this for release builds)
You can get more information here
Related
Deploying my android 64 bit app + android 32 bit app (made in Delphi) in aab format (Android App Bundles) under google play not work under android 32 bit devices. When i start the app it's say that their is no so librairies and failed to start (my app is build inside an SO library). when I use apk extractor (https://play.google.com/store/apps/details?id=com.ext.ui&hl=en) to extract the apk of the installed app i see also that their is no SO libray inside (not even the armeabi_v7a directory). when i explore the aab file with App Bundles explorer i can see that for my android 32 bit device i have this zip file that contain :
1/ base.apk (4Mo) without any libraries inside (the apk I extract for my app with apk extractor)
2/ config.armeabi_v7a.apk (14Mo) with libraries inside (so they are here in a different apk?)
3/ config.en.apk (20 ko)
4/ config.xhdpi.apk (110 ko)
Also When I download the app from google play store, I see the progress bar is growing still 22% and then it's stop and the install of the app start (don't know if it's matter, i try on 2 differents devices)
any idea what wrong? Note: on android 64 devices it's seam to work
one remark, I try to check the aab with bundletool and i find that the extracted apks is
for android 64: base-arm64_v8a.apk : 72Mo (libapp.so is 64 Mo)
for android 32: base-armeabi_v7a.apk : 14 Mo (libapp.so is 46 Mo)
so i don't understand why only 14 Mo on base-armeabi_v7a.apk (or why 64 Mo on base-arm64_v8a.apk)
Ok I found the problem! It's because ih my settings I have for the ndk:
C:\SDKs\android-ndk-r17b\platforms\android-28
C:\SDKs\android-ndk-r17b\platforms\android-28\arch-arm\usr\lib
C:\SDKs\android-ndk-r17b\platforms\android-28\arch-arm\usr\lib;C:\SDKs\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a
in in short I have android-28 instead of android-22
This settings was working perfectly on 10.3.2 of Delphi but when I update to 10.3.3 this make the problem I encountered:
compilation for android32 and android64 work well, running on android64 devices (android32 app or android64 app) work well too
compilation for android32 work well, but running on android32 devices failed !
I didn't detect the problem before to go in production because I made the test of the app (android32 and android64) on my android 64 devices :(
the worse was that google play didn't detect that the library was broken and accept the package, and immediately upload it to all the devices who have my app installed. and no way to roll back, i must absolutely provide a new binary but it's took me some time to understand where the problem was because i didn't have anymore the 10.3.2 in my computer as their is no way to have 10.3.2 and 10.3.3 on the same computer.
conclusion: installing a minor update of delphi is not totally risk free, and don't trust google play to warn you if your package is broken, make strong test before to deploy
I have a xamarin forms solution with visual studio 2019 on mac.
I try to publish my apk on google play console but it says that they are Unoptimised APK.
In visual studio, I went to Android project options > Android Build.
In release configuration, I checked Generate one package (apk) per select ABI. In the advanced tab, I checked the 4 supported ABI. Then I published and then uploaded 4 apks to google play console.
It doesn't seem to be enough, the website advises me to:
- Use the Android App Bundle to automatically optimise for device configurations (Not sure it is supported for xamarin solution)
- or manage it yourself with multiple APKs (which I did with no success)
I cannot ignore the warning, the button to go to next step is grayed.
Unfortunately Xamarin Android does not yet support App Bundles.
They are working on it and will be available soon:
https://github.com/xamarin/xamarin-android/issues/2727
The PR for the build task is already merged: https://github.com/xamarin/xamarin-android/pull/3146
if you want to try the preview version you can try this (from the Xamarin team):
you should be able to download a visx from our CI system via the Build Status section of our README.md (see https://github.com/xamarin/xamarin-android#build-status) and then picking a Job and going to the Azure Artifacts page. Or just use this to get the latest stable build https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/lastStableBuild/Azure/
Note that these will be the Open Source bits only. So some things (like fast deployment) won't work. But if you are building a release app that should be ok.
The only thing you can do until the App Bundles support will be released, is to use one APK per ABI and ignore the warning from Google Play
Until all your GRAY CHECKS in Google Play Console (on the left side menu ) become green, you will not be allowed to publish in play console and ignore the warning.
New in Visual Studio 2019 for windows 16.4 and for Mac 8.4
added support for building android app package aab format
My android release apk size built using Flutter is around 150MB. I would like to upload this apk to the google play store but play store has a apk size limit of 100MB. In Android app development we create APK expansion files for such limit in steps shown in this link. Would like to know the steps in Flutter code to create and use similar expansion files and reduce the app size to below 100MB.
Update
This question is not related to large size of apk due to Flutter. The apk is huge because of the assets used in the app. Want to know the process of uploading such apps in Flutter. In native android development we have the option of expansion files as shown in the link. IS there a similar option for Flutter if not what is the process to upload such apps to google play store.
When building a release version of your app, consider using the --split-debug-info tag. This tag can dramatically reduce code size. For an example of using this tag, see Obfuscating Dart code.
Some of the other things you can do to make your app smaller are:
Remove unused resources
Minimize resource imported from libraries
Support a limited number of screen densities
Compress PNG and JPEG files
or
One way that i use to reduce my app size is to use;
flutter clean
before i run the build command;
flutter build appbundle --target-platform android-arm,android-arm64
Use an appbundle and you get 150mb
https://developer.android.com/guide/app-bundle
use Firebase Storage to download the content (12 cents per gig)
https://firebase.google.com/pricing
or follow the Expansion files inclusion in Flutter (it is very quiet at the moment)
https://github.com/flutter/website/issues/2215
use this command to create multiple small size apk then upload multiple apk in play store
flutter build apk --split-per-abi
Use Deferred components for app-bundle generation if you have larger apk in flutter.
This feature is currently only available on Android, taking advantage
of Android and Google Play Stores’ dynamic feature modules to deliver
the deferred components packaged as Android modules. Deferred code
does not impact other platforms, which continue to build as normal
with all deferred components and assets included at initial install
time
I agree with #RémiRousselet maybe you can check your assets and tell us if that's the case. But if it's not, then maybe it's a package issue.
But as an FYI, Flutter team has an answer for big size APK. Check this. Also check this to know the minimum size of Flutter that they came up with. It was stated that,
we measured the size of a minimal Flutter app (no Material Components, just a single Center widget, built with flutter build apk), bundled and compressed as a release APK, to be approximately 4.48MB.
Judging from that statement, the Flutter APK is really large and it has a fixed overhead size.
Here are some reference you can check regarding how to reduce APK size.
Reduce --release apk and ipa sizes
Would like an article which explains how to reduce APK size
Also check this StackOverflow question related to yours.
I seem to be having a problem with limiting the size of my installed Android Application. During development I used Android Studio to deploy my application to my testing device. The app took a total of 2.32 MB in storage when freshly installed.
The problem in size came up when I published my application to the Google Play Store for alpha testing. I uninstalled the same app I had loaded with Android Studio, then downloaded the one I listed on the Google Play Store. The funny thing is that the same app now takes up 4.11 MB in storage.
How did this occur? The testing environment is the same, therefore what additional libraries or information would need to be added to the app causing it to take up the extra 1.79 MB?
TL;DR
App installed on testing device via Android Studio: 2.32 MB in storage
Same app installed on the same testing device through the Google Play Store: 4.11 MB in storage
Why is there such a significant increase in the size of my application? No other variables aside from installation source have changed.
That's because compiling & installing app into one target device and all devices is different.
When you click the run button, you are targeting only single device.
When deploying a signed release apk, you are targeting all screen densities, intel and arm processors. It includes extra files. It makes your apk file bigger.
Check out this existing answer on SO. Android release apk bigger than debug
The answers point out how a debug version only includes resources for the connected devices screen density. For production all images/res are included. Also, you should be able to further reduce size of your apk by using pro guard if you aren't already.
I have uploaded two APK files into the Google Play store. One is a newer version and one is an older version. The newer version is the active one since it has a higher versionName and Code. Now I found some bugs in the newer version and I want to delete it from the Play Store and activate the older version. Google Play won't let me deactivate the newer one and activate the older one again, since it has a lower versionName and code.
The problem is that I'm am not the developer and did not build the app. The developer is in another country and it is difficult to get hold of them.
What can I do to reactivate the older version again? I know one solution would be to change the versionName and Code. I only have the apk file, can I change those details in Eclipse with only the apk file and very little experience in eclipse or developing android apps?
Thank You
You can't rebuild a new version of an apk from the apk itself.
Have the app developer do the following:
Rebuild project in its previous state with higher version number (must be higher than all previously submitted versions)
Resubmit
From Google's Android "Developer Console" page:
Note that rollbacks aren’t supported due to the app versioning
requirements of the Android platform. If you need to rollback,
consider launching a previous APK with a new version number. However,
this practice should be used only as a last resort, as users will lose
access to new features and your old app may not be forward-compatible
with your server changes or data formats, so be sure to run alpha and
beta tests of your updates.
A good strategy is, when creating a build, modify the manifest to build say a version 2.0 = 39 AND again 2.05 = 45 and generate these two apks which will obviously do the same thing.
Later, when build 2.01 = 40 is in production and you find an error, you can jump back to the old version by uploading the 2.05 = 45 you created earlier.
You have 5 opportunities to back track while releasing 40, 41, 42, 43 and 44 to go back to earlier functionality!
Do this for each build and you can always go back to an earlier version which has been pre compiled and built but with a higher version number than currently in production.
You will not be able to change the APK file without having the signing certificate.
You should be able to revert to an older version, assuming you didn't change the level of API support.
Presumably, go to the Dev console, select the APK tab, hit the "Advanced Mode" option, deactivate the current version and hit "Reactivate" for the version you want.