How to reduce apk with Android App Bundle and how to build for 64-bit requirement

I have 2 questions both of them about building xamarin forms app for android for google play console, I will ask in one post

  1. I see in google play console that my apk would be smaller if I use Android App Bundle, is there an option in visual studio 2017 to do it? I also opened the apk with android studio and try to do it from there I couldn't make it

  2. Get your apps ready for the 64-bit requirement - I did the check https://developer.android.com/distribute/best-practices/develop/64-bit
    I found the armeabi-v7a I don't have the arm64-v8a or x86_64, so I have 32-bit , how should I build for for 64-bit requirement , is there a way with visual studio 2017 ? what should I do?

Posts

  • DirkWilhelmDirkWilhelm USMember ✭✭✭✭

    As for your second question:

    Your.Droid.Project -> Properties -> Android Options -> Advanced ->Supported architectures -> check the 64bit checkboxes

  • TaliAvrahamTaliAvraham USMember ✭✭

    Thank you Dirk Wilhelm, it was fast

  • TaliAvrahamTaliAvraham USMember ✭✭

    Actually since I have checked the the 64 bit checkbox, I am getting Java ran out of memory while executing , nothing helps to remove this error

  • DaddoonDaddoon FRMember ✭✭

    Did you try to go to Android Options => Advanced => change the "Max Java memory heap" or something like that ? (Sorry my Visual Studio is in French) . Put something like 4G

  • TaliAvrahamTaliAvraham USMember ✭✭

    of course I already tried all the options that the internet suggest... :'(

  • softlionsoftlion FRBeta ✭✭✭

    Set VS build option to detailed, rebuild, you will see the real error.

  • mac121mac121 Member ✭✭✭

    This link has a wonderful answer to updating android app to support the 64-bit architecture as per Google requirement:

    https://stackoverflow.com/questions/54537469/targeting-64-bit-architectures-on-xamarin-android

    Go into your Project settings / Build / Android Build / Advanced and enable arm64-v8a as one of your supported ABIs.

    And then do a fresh build (or a new archive if you are using that feature of VS).

    Note: Make sure you do this for your Release configuration

  • ClaudyDetryClaudyDetry USMember ✭✭

    Hello TaliAvraham,

    Could you find a way to generate the Android App Bundle ?
    It looks that APK's cannot be published on Google Play Console anymore :-(

    Best regards.

  • JoeMankeJoeManke USMember ✭✭✭✭✭
    edited June 12

    @ClaudyDetry Did they make that change today? I get warnings recommending that I switch to using App Bundles but it still let me publish an APK yesterday.

  • ClaudyDetryClaudyDetry USMember ✭✭

    @JoeManke It is the first time I am using the console. "START ROLLOUT TO ALPHA" button remains grey and inactive.
    Not in your case?

  • GiampaoloGabbaGiampaoloGabba USMember ✭✭✭

    @ClaudyDetry said:
    @JoeManke It is the first time I am using the console. "START ROLLOUT TO ALPHA" button remains grey and inactive.
    Not in your case?

    You can still pubblish apps even if not in the App Bundle format. Regarding the App Bundles they are coming, full answer here: https://stackoverflow.com/questions/56494591/how-to-optimize-apk-per-abi-when-using-xamarin-and-visual-studio/56494765#56494765

  • DiogoVieiraDiogoVieira USMember ✭✭

    Hi!

    I'm also having trouble publishing my apk on the Google Play Console. There is an error that @TaliAvraham commented on.

    APK not optimized
    Notice:

    This APK includes features and unused codes that are sent to users. Your app would be smaller if you used the Android App Bundle. When the app is not optimized for device settings, the download and installation size is larger than necessary. Larger apps have lower installation fees and take up space on users' devices.

    Resolution:

    In order to automatically optimize the app for multiple device configurations, use the Android App Bundle or create multiple APKs.

    Has anyone managed to solve this problem?

  • softlionsoftlion FRBeta ✭✭✭

    Ignore the warning (its a warning)

  • DiogoVieiraDiogoVieira USMember ✭✭

    I think I can not ignore it, because the start button is disabled. See the image.

  • FonagerFonager DKMember ✭✭

    Any solution to this? I'm stuck on the same page and desperately needs to deploy a customer app :-(

  • batmacibatmaci DEMember ✭✭✭✭✭
    Button is grayed out has nothing to do with those warnings. You haven't completed artifacts, certification etc. One of these. You need to go through app publishing processes on android.
  • batmacibatmaci DEMember ✭✭✭✭✭
    App bundles are developed by xamarin team and it is in nightly or pre release update. Check on xf github for related issue. There is more information
  • batmacibatmaci DEMember ✭✭✭✭✭
    Regarding app size on android there is a perfect article from Adam Pedley. You should go through this article. One last thing in my case Vs2019 mac os generates smaller apk than windows vs2019. I dont know why
  • UFUKZIMMERMANUFUKZIMMERMAN USMember ✭✭

    @batmaci said:
    Button is grayed out has nothing to do with those warnings. You haven't completed artifacts, certification etc. One of these. You need to go through app publishing processes on android.

    Yess!! True!

Sign In or Register to comment.