How to support API levels < 14?

2019-07-11 17:07发布

As it is known, the minimum API level for using the Android support library is 14 now. I would like to release a new version of my app (currently minSdk 15 and targetSdk 27) to support API < 14 (down to Froyo at the minimum if possible). Why you ask? I do not plan to keep supporting for these old system versions, but rather just to fix one critical bug to help the numerous users I have on these platforms - a bug which will actually help them export their data to newer versions.

When changing the minSdk to 10 I get the following error:

Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version 14 declared in library [com.android.support:appcompat-v7:27.1.1] as the library might be using APIs not available in 10 Suggestion: use a compatible library with a minSdk of at most 10, or increase this project's minSdk version to at least 14, or use tools:overrideLibrary="android.support.v7.appcompat" to force usage (may lead to runtime failures)

Anyway, here is what I considered - or a combination of the following:

  1. Using an old support library version 25.4.0 that work with minSdk < 14 as an "oldApi" product flavor (and the new support library version for the normal release flavor)
  2. Use the original methods from the old platform versions without support libraries at all and then release an APK with minSdk X and maxSdk 14
  3. Multi APK release

What is the best approach? Is there an easier way?

0条回答
登录 后发表回答