Error text
uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library [com.example:lib:2.0] Suggestion: use a compatible library with a minSdk of at most 21
uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library [com.example:lib:2.0] Suggestion: use a compatible library with a minSdk of at most 21
A library needs a newer Android than your app allows. The app's minSdk is lower than the library's.
minSdk to that number.tools:overrideLibrary="com.example.lib" in the manifest. It may crash on old phones, so test first.android { defaultConfig { minSdk = 24 } }
./gradlew :app:processDebugManifest --stacktrace
./gradlew :app:dependencyInsight --dependency lib --configuration debugRuntimeClasspathChoose minSdk by looking at market share, and check it for every new library.
Author and license: Nibras Code