简体   繁体   中英

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. 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. 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. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

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.

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'. Otherwise, Android Studio will use the signing info to sign the APK instead of the bundle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM