Can't find Android dynamic feature module to download

656 views Asked by At

My app is already in the Playstore. I want to add a dynamic feature to it.

Whenever I try to test and see if it works with internal tests, it gives me error -2 and says that it can't find the feature's module. Which is weird because the bundle I uploaded has it. Could this be because when it tries to download it, it gets confused by the app that's already in the playstore (Which does not have the module)?

2

There are 2 answers

0
RedHac On

Clarification : As it is said, in this case we are uploading a bundle file to the playstore not an apk.

0
Amritpal Singh On

Are you generating an apk which has your feature module included into it. you can try using bundle-tool and use its mode --mode=universal to generate an apk which will include your all feature modules.

Also if you want to test your dynamic modules locally you can use its --local-testing flag.

Here are the steps:

./gradlew bundleDebug

bundletool build-apks --bundle=./app/build/outputs/bundle/internalDebug/app-internal-debug.aab --output=./app/build/outputs/apks/universalapk.apks --mode=universal

To extract an apk out of it..you can rename universalapk.apks to universalapk.zip and open it. you will get the apk

or to install it, you can use:

bundletool install-apks --apks ./app/build/outputs/apks/universalapk.apks

Refer to this link: for generating apk with feature modules: Generate Apk file from aab file (android app bundle)