27

I received an email from Google that we need to start supporting 64-bit CPUs in our Android apps by August 1, 2019. In their documentation, it states that there should be a lib/arm64-v8a folder in your apk contents if you're correctly supporting 64 bit.

enter image description here

In my Xamarin Project Options > Build > Compiler settings, my Platform target is set to "Any" so I would expect it to build both 32 and 64 bit versions. However, when I generate a release build and package it into an apk, when I browse the apk it only has a lib/armeabi-v7a folder, there is no v8a folder. So what do I need to do to support 64 bit architectures?

EDIT: I should have included this screenshot, showing my Supported ABIs:

enter image description here

Justin
  • 15,926
  • 28
  • 119
  • 175
  • 1
    Have you read [this](https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/cpu-architectures?tabs=windows)? – TheWanderer Feb 05 '19 at 15:16
  • 1
    Also make sure your Release config follows this... My Debug defaulted to it, but for some reason Release was set to armeabi-v7a only. :) – Auri Rahimzadeh May 02 '19 at 23:40

3 Answers3

34

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

enter image description here

SushiHangover
  • 68,368
  • 9
  • 89
  • 150
  • Correct, Configuration dropdown is set to "Release-Prod". – Justin Feb 05 '19 at 15:49
  • 3
    It's strange, yesterday my Release-Prod configuration was showing as all 4 boxes checked, but today after reopening VS only the armeabi-v7a was checked. So I checked arm64-v8a and republished, and the apk now contains the 64 bit version. Thanks! – Justin Feb 06 '19 at 20:20
  • 1
    Stupid question, but where is `Project Settings` located? I've looked under `Project` and `Build` at the top, right-clicked on the Project in the Solution Explorer, opened the Project and looked at its Properties there... I can't find the menu you're talking about. – Kyle Humfeld May 24 '19 at 19:41
  • 1
    It took me a while to find it, but in VS 2019, under the Settings for the Android Project, under Android Options, there's a button at the bottom of the main pane that says 'Advanced'. The first dropdown in the window that appears when you click that button has the options noted in the above screenshot. – Kyle Humfeld May 24 '19 at 20:06
  • 4
    For those unable to find it in VS for *Windows* right click Android project, Properties, Android Options, Advanced button in bottom right https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/cpu-architectures?tabs=windows – KRA2008 May 29 '19 at 00:11
  • How can I identify a 64-bit Android phone before purchase? I know how to determine after purchase. I need a 64-bit Android testing device. Purchasing a phone with a 64-bit ARM CPU does not guarantee it is running a 64-bit Android OS, only that it is capable, – Ed of the Mountain Jun 11 '19 at 19:38
  • @SushiHangover ARM64 hardware does *NOT* mean the device is running Android 64-bit. One example, I purchased a Moto G7; ARM64 and 4GB RAM but runs Android 32-bit. I cannot use ADB on a device I have not yet purchased. I can only find out if I I made a mistake after purchase. A Samsung S7 has ARM64 and only 1.5GB RAM but does run 64-bit Android. The only solution is to have access to the device before purchase or ask a friend and get same exact model. Of course RAM > 4GB is not addressable by 32-bit Android. This does not help much as few devices have > 4GB RAM. – Ed of the Mountain Jun 12 '19 at 20:12
  • @SushiHangover so it's even worse. You need to know the *exact* model number too. The *Motorola Moto G7* I purchased less than 8-months ago is running 32-bit Android 8.0.0, API 26. The only solution seems to be to have access to the device before purchase or ask a friend and get same *exact* model. Where did you find "SD632" model displayed? – Ed of the Mountain Jun 12 '19 at 20:34
2

As @sushihangover mentioned, you just have to Make Sure that on your "Release" configuration, you need to select the arm64-v8a ABI configuration. Remember to "Rebuild All" before you hit "Archive for Publishing" so that you don't run into issues based on cached data. You can view this article for more details and a video.

Saamer
  • 3,694
  • 1
  • 6
  • 33
0

In my case (after many weeks of frustration), it turns out that Google Play Console (depending on app release setting) may try to 'retain' older versions of your application. You need to remove all older versions during the release.