简体   繁体   English

签署App Bundle基本模块和动态功能模块

[英]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 像这样做

  1. menu "Build" 菜单“构建”

  2. 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.

相关问题 App Bundle - 动态功能模块:在动态功能模块错误中找不到基础项目 - App Bundle - Dynamic feature modules : Base project not found in dynamic feature module error App Bundle动态功能模块中的访问资源 - Access Resources In Dynamic Feature Module of App Bundle App Bundle,在动态功能模块中,安装前可用的模块 - App Bundle, In Dynamic Feature Module, Module available before install 在基本(应用程序)模块中显示来自动态功能模块的片段? - Show Fragment from Dynamic Feature Module in base (app) module? 与动态功能模块(App Bundle)一起安装时出现“没有足够的存储空间” - "Not enough storage space" when installed with Dynamic Feature Module (App Bundle) App Bundle:应用程序类可以在动态功能模块中吗? 应用程序包崩溃 - App Bundle: Can Application class be in a Dynamic Feature module? App bundle crashes 从基础模块调用动态特征代码 - Call dynamic feature code from base module 在基本模块中找不到动态功能模块中的 Android 提供程序 - Android Provider in Dynamic Feature module not found in Base Module Android App Bundle:Google Play 150MB 限制似乎包括动态功能模块大小? - Android App Bundle: Google Play 150MB limit seems to include the Dynamic Feature Module size? 如何使用功能代码管理应用程序更新时的代码动态功能模块? - How to manage the code Dynamic Feature Module on app update with feature code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM