You can use, Manifest Merger to Override <uses-sdk>
for imported libraries.
From the official documentation:
By default, when importing a library with a minSdkVersion value that's
higher than the main manifest file, an error occurs and the library
cannot be imported. To make the merger tool ignore this conflict and
import the library while keeping your app's lower minSdkVersion value,
add the overrideLibrary attribute to the tag. The attribute
value can be one or more library package names (comma-separated),
indicating the libraries that can override the main manifest's
minSdkVersion.
For example, if your app's main manifest applies overrideLibrary like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app"
xmlns:tools="http://schemas.android.com/tools">
<uses-sdk android:targetSdkVersion="22" android:minSdkVersion="2"
tools:overrideLibrary="com.example.lib1, com.example.lib2"/>
...
Then the following manifest can be merged without an error regarding the <uses-sdk>
tag, and the merged manifest keeps minSdkVersion="2"
from the app manifest.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib1">
<uses-sdk android:minSdkVersion="4" />
...