21

Given a APK, how can we find whether its a 32-bit app or a 64-bit app? I am observing an app is unable to run on 64-bit android OS. I guess its a 32-bit app.

JorgeAmVF
  • 1,660
  • 3
  • 21
  • 32
Tanmay Varun
  • 498
  • 2
  • 6
  • 16
  • APKs are not 32-bit or 64-bit. NDK binaries (`.so` files) inside of APKs will be compiled for specific CPU architectures. Generally, 32-bit binaries should work fine on 64-bit CPUs. – CommonsWare May 20 '15 at 11:25
  • https://stackoverflow.com/a/54566250/6667442 – Ketan Ramani Feb 07 '19 at 04:23
  • Ensure that your app supports 64-bit devices check this article https://developer.android.com/distribute/best-practices/develop/64-bit – Gitesh May 24 '19 at 08:59

2 Answers2

33

APK is ZIP. You can open it and check directory lib to see which architectures are supported. If there is no directory lib, it supports all architectures.

64-bit Android is backwards compatible and can run 32-bit applications. On the other hand, Intel Android (both 32-bit and 64-bit) has very limited compatibility with ARM Android (a binary translator called libhoudini is shipped on Intel but from my experience, it works for only very simple code), and ARM Android is completely incompatible with Intel Android. This affects only applications with NDK code in lib, pure Java applications can be run on both.

StenSoft
  • 9,369
  • 25
  • 30
  • 1
    "64-bit Android is backwards compatible and can run 32-bit applications" - is this documented somewhere? – Xiao Mar 01 '16 at 21:58
  • 1
    @Xiao [Android CDD](https://static.googleusercontent.com/media/source.android.com/cs//compatibility/android-cdd.pdf), section 3.3.1: _MUST support the equivalent 32-bit ABI if any 64-bit ABI is supported_ – StenSoft Mar 02 '16 at 14:11
  • 1
    So, I have no "lib" directory nor ".so" files in my app. I guess it is 64-bit compliant. Is there any thing to do ? Is there any flag to check in the Google Play Console to mark the app as 64 bit compliant ? Can I just ignore the newsletter sent by google with subject "Get your apps ready for the 64-bit requirement" ? – Pablo Alfonso Jan 29 '19 at 14:32
  • 2
    @PabloAlfonso so mine, my APK doesn't have any lib directory nor ".so". I think it's only applicable for developer which use native code. This is pretty clear I think "Many apps are written entirely in non-native code (e.g. the Java programming language or Kotlin) and do not need code changes." – Darari Nur Amali Feb 01 '19 at 00:31
  • @PabloAlfonso You can ignore it, Google sends this announcement to everyone, I don't have any app published and received it as well – StenSoft Feb 01 '19 at 19:12
  • @StenSoft There is no `lib` folder and no `.so` files in the Apk. Still it is showing "The release is complaint with Google play 64-bit requirement". Do you have any clue? – Uma Sankar Nov 19 '19 at 11:05
  • I accidentally installed the 32 bit version of Google Play Services on my phone, it kept crashing and I couldn't revert it so I had to factory reset my phone. – harveyhans Jun 04 '21 at 01:29
0

Apps without JNI

If you're not using the JNI, your APK won't contain any .so files.

Apps with JNI

Unzip the APK, e.g. unzip tensorflow-lite.aar -d tensorflow-lite

Look inside /jni, and observe the directories inside it:

It looks like the APK/ AAR I unzipped contains .so files for all 4 JNI ABI's. This is good, because I built the tensorflow lite library for all platforms.

enter image description here

Ben Butterworth
  • 22,056
  • 10
  • 114
  • 167