3

简单聊一聊 Android App Bundle 的话题

 2 years ago
source link: http://www.androidchina.net/11850.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

这一篇主要是有感而发,抽空和大家聊聊关于最近 Google Play 上传应用需要更改为 AAB 的话题,顺便说下更改为 AAB 的一些简易流程。

关于 AAB 的话题

如下图所示,最近在收到了不少“不明觉厉”的朋友给我类似的文章,知乎也收到一些类似的问题邀请,就顺便“蹭点”热度聊聊,也给“局外人”一些科普。

先简单说一下,如下图所示,去年的时候就收到了谷歌的通知,2021 年 8 月份需要提交为 App Bundle 的格式

image.png

因为 Apk 格式在 Google Play 一直只能支持 100M 的大小提交,而 App Bundle 支持 150M 的大小提交,并且超过 150M 的部分可以通过 Play Asset DeliveryPlay Feature Delivery 去交付,结合 Feature-on-Feature 插件支持可以更好实现动态化的依赖管理。

其实早在 2018 的时候 Android 就有 App Bundle 的打包模式,所以把这次 APK 变成 AAB 的行为和鸿蒙相关联,其实就是媒体为了蹭热度吸引流量的炒作居多。

更何况如下图所示,华为应用商店的提交本身就支持 AAB 的 格式:

关于更新为 AAB 的提交流程

在 Google Play 上,把上传 apk 更改为 aab 文件,打包过程中需要注意:

  • Android App Bundle 不支持 APK 扩展 (*.obb) 文件;
  • 需要为 APK 设置 enableSplit = true ;
  • 移除不用的代码和资源以缩减应用大小;

上传 AAB 到 Google Play ,首先需要在 Play App Signing 打开签名,之后需要上传一个 Private Key 来校验。

这个 Key 可以通过 Android Studio,在 Generate Signed Bundle or Apk 的时候,选择 App Bundle ,并勾选 Export 导出 *encrypted key 用于上传使用即可。

PS : 这里主要注意不要用错签名 Key 就行,不然后果很严重 !

总结来说,关于 Android App Bundle 的问题会拉扯上鸿蒙,主要还是营销和流量需要,事实上 AAB 和鸿蒙不冲突也不影响,大家看到类似标题的时候,图个乐就行~


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK