Tran An
06/12/2023, 1:52 PMJakub Syty
06/12/2023, 1:59 PMJakub Syty
06/12/2023, 1:59 PMeenriquelopez
06/12/2023, 2:10 PMTran An
06/12/2023, 2:40 PMHasan Hosgel (alosdev)
06/12/2023, 3:14 PMDaniel B Duval
06/12/2023, 9:12 PMErik Ghonyan
06/13/2023, 7:53 AMtargetSdk
as "the latest version of Android on which I've tested my app and it works". So as long as you test your app and it works you're fine, meaning that changing your app's targetSdk
version is enough and it's not required to update the library modules.
BUT, you're unlikely to test every single possible scenario, so it's better if your dependencies (lib modules and third-party libs) have a higher or equal targetSdk
version than the app module. Then lint and other tools can catch some of these issues at compile time or in tests. The app module's version will take precedence, it's ultimately what the app will be packaged with and what the OS will see. However, the Android Gradle Plugin will take the libs' versions into account and make some changes to the merged manifest file, e.g. add permissions.
My recommendation would be to share the same targetSdk
version across all library modules, e.g. by using convention plugins, but set the app's version explicitly in its build file