Android can we create universal (single) aar file for all build type variants like debug, release ,uat, gold etc

30 views Asked by At

Android can we create universal (single) aar file for all build type variants like debug, release ,uat, gold etc. If yes what's it's pros and cons.

1

There are 1 answers

0
snachmsm On

no, you can't

when you are building an app and want to make an APK file then you are building it according to buildtype set rules, most common is release and debug, two default in every project, and only one can be set at once. most often debug is made when you are debugging, release is when you are picking Build -> Generate signed Bundle / APK

same for AAR, as this is very similar to APK, same way, but instead of standalone code ("installable" APK file) you are getting specific library, which must be implemented in other software. still it must be built, as release or debug, or other type of build. probably also release, when you are planning to give it for 3rd-party

still you may produce two/multiple aars, debug and release (and more if you have), place both/all in "hosting" project and set up in gradle files which should be used for debug, which for release, which for other