android - 签署App Bundle基础模块和动态功能模块

标签 android android-app-bundle

在 Google App Bundle 官方指南中:https://developer.android.com/guide/app-bundle/configure#base_build_config它说签名信息只需要在基本模块 build.config 文件中指定。动态模块签名信息与基本模块一起使用。

我正在使用自己的 keystore 文件,因此我只在基本模块中包含签名配置。但是,当我在设备上构建并运行该应用程序时,它总是弹出错误:

Installation failed with message Failed to finalize session : INSTALL_FAILED_INVALID_APK: /data/app/vmdl538875391.tmp/1_feature_-debug signatures are inconsistent. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

当我在动态模块中包含签名信息时,错误消失了。 那么这和官方指南有冲突吗?还是我在这里做错了什么?

最佳答案

该问题是由编辑配置中的设置引起的。为了仅在 bundle 的基本模块中包含签名信息,我需要选择“应用程序 bundle 中的 APK”,而不是“默认 APK”。否则,Android Studio 将使用签名信息对 APK 而不是 bundle 进行签名。

关于android - 签署App Bundle基础模块和动态功能模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52246619/

相关文章:

android - TextAppearance.MaterialComponents.Body2 的定义?

java - 取消 PendingIntent |代码没有效果

java.io.IOException : grpc failed

java -> 无法初始化类 com.android.repository.api.RepoManager

android - AppIcon 将在装有 Android App 的设备上显示两次

java - 如何在 SQLite android studio 中替换表

android - 是否可以将 app bundle 用于 android 智能手机但不能用于 Android TV?

android - 是否应授权测试人员进行内部应用共享以使用链接安装应用?

android - android app bundle 和 proguard rules 做同样的优化吗?

android - 如何创建 .pwd 文件来为 Bundle Tool 签名 APK 集?