在 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/