'tools:overrrideLibrary doesn't recognize library and forces to use AndroidX

My Android Studio project has minSdk 10. It still uses legacy libraries. Indeed the build.gradle file contains:

android.useAndroidX=false
android.enableJetifier=false

I imported a Maven legacy dependency that requires minSdk 14. implementation 'com.android.support:webkit:28.0.0'. Obliviously I got a compiling error. Since I don't want to increase the project minSDK, I tried to ignore the error. To do that, I added this line to the Manifest:

<uses-sdk
        tools:overrideLibrary="com.android.support.webkit" />

The problem is that I still can't compile the project since the error message asks to do "ovverrideLibray" for the new AndroidX library, and not for the old legacy library!

use tools:overrideLibrary="androidx.webkit" to force usage

(I just want to ignore a minSdk library error, who cares if the library is new or old!)

How can I solve this problem?

This project targets some old devices, and switching to AndroidX would be worse. I just want to add that legacy library ignoring the error.

Any solution? Thank you in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source