Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Targeting 64 bit architectures on Xamarin Android

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

like image 212
Justin Avatar asked Feb 05 '19 15:02

Justin


People also ask

How do I change my target version in Xamarin?

Go to android project then right click -> Properties -> Android Manifest (scroll down) then you will see Minimun android version and Target android version.

What is arm64 v8a?

arm64-v8a. This ABI is for ARMv8-A based CPUs, which support the 64-bit AArch64 architecture. It includes the Advanced SIMD (Neon) architecture extensions. You can use Neon intrinsics in C and C++ code to take advantage of the Advanced SIMD extension.

Is Xamarin getting deprecated?

In May 2020, Microsoft announced that Xamarin. Forms, a major component of its mobile app development framework, would be deprecated in November 2021 in favour of a new .

Is Xamarin good for Android development?

Since its appearance in 2011, Xamarin has become a great option for cross-platform app development, a faster way to build iOS, Android, and Windows apps.


2 Answers

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

like image 158
SushiHangover Avatar answered Sep 22 '22 05:09

SushiHangover


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.

like image 24
Saamer Avatar answered Sep 20 '22 05:09

Saamer