Android studio曾用于生成1个版本的apk,现在它是3.他们每个人做什么?

hue*_*y77 5 android apk google-play android-studio

所以我有一段时间没有发布.Android Studio曾经只生成一个apk,这是一个发布版本.这次它生成3如下:

1.app-armeabi-v7a-release.apk
2.app-x86-release.apk
3.app-universal-release.apk
Run Code Online (Sandbox Code Playgroud)

我将假设我想将通用版用于Google Play商店.
但有人可以打破每个人的具体细节吗?

ישו*_*ותך 4

生成的 apk 每个都针对特定的 CPU 架构。它们通常是在 apk 中使用本机库时生成的(更多信息请参阅将 C 和 C++ 代码添加到您的项目)您可以在ABI Management中阅读相关内容,摘录如下:

Different Android handsets use different CPUs, which in turn support different instruction sets. Each combination of CPU and instruction sets has its own Application Binary Interface, or ABI. The ABI defines, with great precision, how an application's machine code is supposed to interact with the system at runtime. You must specify an ABI for each CPU architecture you want your app to work with.

Each will contain specific instruction for the Architecture, except the app-universal-release.apk.

app-armeabi-v7a-release.apk is for v7-a ARM devices

app-x86-release.apk is for "x86" or "IA-32"

app-universal-release.apk contains both of the specific instruction in app-armeabi-v7a-release.apk and app-x86-release.apk

You can use just the universal one, but you probably will not want to use it if the generated apk is too big. User tend to avoid a big application in the play store. So, to overcome this, you need to break the apk to a specific one so the resulted apk is smaller.

If you don't want to use the universal one, then you need to upload each of the specific apk to the Play Store. When user visit the application in the Play Store, he/she will be served with the specific apk matching with his/her device CPU type.