Android recently came out with a new com.android.feature
plugin to be used to split up applications into features for the new Instant apps. It seems to be an ar
Update (as of May 2019): for anyone stumbling on this post, the details below are largely out-of-date now. The feature plugin (com.android.feature
) is no longer "new" and is actually now being deprecated in favour of instant-enabled App Bundles. Read more on that in the official blog post.
The new feature plugin (com.android.feature
) is actually almost identical to the existing library plugin (com.android.library
) in the way it behaves and the way it's used.
The key difference is that the library plugin will always output an Android Archive (AAR
) file where the feature plugin is able to output an AAR
file when the build targets a regular Android application (via plugin com.android.application
) and an APK
file for that module when the build targets an Instant App (via plugin com.android.instantapp
).
What are the benefits right now? Currently you only need to use the feature plugin to build for Google Play Instant (previously called Android Instant Apps). There are minimal benefits right now to using the feature plugin if you are NOT planning to build for Google Play Instant. One minor benefit might be you can output APKs
for each module of your app and could install and test them independently.