[英]Signing The App Bundle Base Module And Dynamic Feature Module
In the Google official guide for App Bundle: https://developer.android.com/guide/app-bundle/configure#base_build_config it said that signing information only needs to be specified in the base module build.config file. 在Google App Bundle官方指南中: https : //developer.android.com/guide/app-bundle/configure#base_build_config,它说签名信息只需要在基本模块build.config文件中指定。 The dynamic module signing info goes with base module.
动态模块签名信息与基本模块一起提供。
I am using my own keystore file, so I only include the signingConfig in the base module. 我正在使用自己的密钥库文件,因此我仅在基本模块中包括signingConfig。 However, when I build and run the app on a device, it always pop up the error:
但是,当我在设备上构建并运行该应用程序时,它总是弹出错误:
Installation failed with message Failed to finalize session : INSTALL_FAILED_INVALID_APK: /data/app/vmdl538875391.tmp/1_feature_-debug signatures are inconsistent.
安装失败并显示消息无法完成会话:INSTALL_FAILED_INVALID_APK:/data/app/vmdl538875391.tmp/1_feature_-debug签名不一致。 It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.
可以通过卸载apk的现有版本(如果有)来解决此问题,然后重新安装。
When I include the signing info in the dynamic module, the error goes away. 当我在动态模块中包含签名信息时,错误消失了。 So does this conflict with the official guide?
那么这与官方指南有冲突吗? Or did I do anything incorrect here?
还是我在这里做错了什么?
Do it like this 像这样做
menu "Build" 菜单“构建”
run "Rebuild Project". 运行“重建项目”。
Then run app on device or emulator 然后在设备或模拟器上运行应用
or if the above solution doesn't work. 或者上述解决方案不起作用。
Then try this 然后试试这个
Disable the Instant run in Android Studio and then Clean, Rebuild and Run , It should fix this issue. 禁用Android Studio中的即时运行 ,然后禁用清理,重建和运行 ,它应该可以解决此问题。
The problem is caused by a setting in Edit Configuration.. In order to only include signing info in the base module of a bundle, I need to choose 'APK from app bundle', not the 'default APK'. 问题是由“编辑配置”中的设置引起的。为了仅在包的基本模块中包括签名信息,我需要选择“来自应用包的APK”,而不是“默认APK”。 Otherwise, Android Studio will use the signing info to sign the APK instead of the bundle.
否则,Android Studio将使用签名信息对APK而不是捆绑包进行签名。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.