Search code examples
androidandroidx

Androidx min sdk


What is androidx min sdk? I just migrated to androidx and i need to support minsdk 14. But my build fails indicating that androidx.browser:browser:1.0.0 has minsdk 15. I can't find it in release notes or anywhere else


Solution

  • androidx.browser:browser:1.0.0 requires the minSdk = 15 (see) in order to function properly, so generally theres no way to support minSdk = 14 while still using androidx.browser:browser:1.0.0.

    So basically you have these options:

    a. Set minSdkVersion to 15 in app level build.gradle file(and stop supporting minSdkVersion 14)

    However if u 'must' have to support minSdkVersion 14 :

    b. You can add this line in AndroidManifest.xml file just before application tag:

    <uses-sdk tools:overrideLibrary="androidx.browser"/>
    

    this will ensure the project will run properly in most cases but it might lead to run time crashes in few occasions.If you are not really using some feature of the class that absolutely requires sdkVersion 15 then u might just get lucky.

    c. Look for alternative classes that can do similar behaviour with minSdkVersion 14 (this might be extremely unlikely)

    d. You can consider reverting back to android support libraries instead of androidx. Since, android support libraries will continue to stay around in the google's maven repo for a while.