2

Android studio 3.3 just released yesterday has new items in the Build Variants tab and I cannot figure out which one is recommended for release. I need this info to be able to create SHA1 with the right variant for auth library yet I cannot find it anywhere in the docs yet.

Extra info: I have D8 and R8 enabled so is it also still necessary to include minifyEnabled or proguard location in those build variants

enter image description here

Geek Guy
  • 710
  • 1
  • 8
  • 28

1 Answers1

3

That arm64-v8a is type of cpu architecture for which you compile your native code, so it depends on what device or emulator you will run your application. Different devices has different CPU architectures.

For more info about them see: https://developer.android.com/ndk/guides/abis

When you build your resulting APK for distribution (so you don't use "Run" command to run directly on your device), it should contain all ABI variants in the resulting APK, unless you specify in gradle or in ndkBuild/CMake config that you want to build only some of them.

EDIT: Just to summarize from comments, so author can accept this answer:

My point is that you don't need to do anything special related to new Android Studio. It should work the same. To verify, open your production APK (Build / Analyse APK...) and see if somewhere inside (probably in root folder /libs/* ) are subfolders armeabi-v7a, arm64-v8a, x86, etc. with native binaries (*.so files).

Robyer
  • 4,632
  • 2
  • 23
  • 21
  • In a case where you are taking your app live and you don't want to specify devices, there is definitely a number of cpu architectures out there, which one is **most recommended?** , that can run in many existing devices if not all. – Geek Guy Jan 16 '19 at 13:50
  • @GeekGuy I think that `Build Variants` panel doesn't affect building the production APK (via `Build / Build Bundle(s)/APK(s)` nor via Gradle's `assemble` task), but it's used only for Run action. So what you select there affects only building and running on your device. – Robyer Jan 17 '19 at 09:53
  • And there is no *most recommended* cpu architecture. For example desktop processors are usually x86 (32-bit) or x86_64 (64-bit), phones/tablets are usually ARM (armeabi-v7a or arm64-v8a, previously armeabi for older phones). So for production APK you should for maximum compatibility compile native code for all architectures (note you can have binaries for ALL different architectures in single APK and that's how it is by default I believe). – Robyer Jan 17 '19 at 10:03
  • Noted, than you, I'll have to read more about it in order to target more users – Geek Guy Jan 17 '19 at 14:15
  • 1
    My point is that you don't need to do anything special related to new Android Studio. It should work the same. To verify, open your production APK (Build / Analyse APK...) and see if somewhere inside (probably in root folder /libs/*) are subfolders armeabi-v7a, arm64-v8a, x86, etc. with native binaries (*.so files). – Robyer Jan 17 '19 at 15:17