I started converting my app to support instant feature , following the Google IO tutorial . I got the build running correctly. I've disabled aapt2
and enableNewResourceProcessing
as i was running into build errors . The module builds without errors after disabling those two flags
but when i go to edit configuration of the base Feature of the app i get The module cannot be android library
.
Does anyone know what causes this issue. I'm using com.android.feature plugin
in the feature module's build along with build flavours and build types .
A feature module is treated as a library. It doesn't have an application ID. So, "The module cannot be android library" error is generated.
The problem I was facing was that there was a build configuration for the instant feature as well. Since each instant feature is considered as an android library, Studio throws errors saying module cannot be android library
. To solve this i simply removed the build configuration via
Run -> Edit configuration -> Click on - button
Keep your base app module configuration and delete all other feature configurations.
Don't run your feature
. Run your instantapp
instead and set feature URL in it:
Run -> Edit Configurations -> Android App -> instantapp -> General -> Launch Options -> Launch = URL -> URL = https://example.com/my_feature
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.