如何支持API级别<14吗 [英] How to support API levels < 14?

查看:97
本文介绍了如何支持API级别<14吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

众所周知,使用Android支持库的最低API级别现在为14.我想发布我的应用程序的新版本(当前为minSdk 15和targetSdk 27​​)以支持API<14(如果可能的话,请最小化到Froyo).你为什么问?我不打算继续支持这些旧系统版本,而只是修复一个关键错误以帮助我在这些平台上拥有大量用户-该错误实际上将帮助他们将数据导出到较新版本.

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.

将minSdk更改为10时,出现以下错误:

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

清单合并失败:uses-sdk:minSdkVersion 10不能更小比库中声明的版本14[com.android.support:appcompat-v7:27.1.1],因为该库可能是使用10中不可用的API建议:使用兼容的库的minSdk最多为10,或增加此项目的minSdk版本至少为14,或使用工具:overrideLibrary ="android.support.v7.appcompat"强制使用(可能会导致运行时失败)

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. 使用与minSdk<兼容的旧支持库版本25.4.0.14作为"oldApi"产品风格(以及正常发布风格的新支持库版本)
  2. 使用完全没有支持库的旧平台版本的原始方法,然后使用minSdk X和maxSdk 14发布APK
  3. 发布多APK

什么是最好的方法?有没有更简单的方法?

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

推荐答案

我支持从API 9开始的库(是的,Android 2.3及更高版本.在2020年.这对我来说是一种挑战).我已经用API 4(!)对其进行了测试,并且一切都很好,但是自API 9以来,Material Design就支持了,所以我也使用从API 9开始的Support Design库的25.4.0版本.它是最喜欢的解决方案对我来说,因为使用Material Design只能从API 9到API 30获得一个API 9-30的apk,因为25.4.0于2017年6月发布,即使API 30也没有改变基本方法.BTW在新的支持库版本中,我看不到任何严重更新,可以将我的最小API版本提高到14,当然也可以提高.

I'm supporting my libraries started from API 9 (yes, Android 2.3 and up. In 2020. It's some kind of challenge for me). I've tested it with API 4 (!) and all is working great, but Material Design supporting since API 9, so I'm using the 25.4.0 version of Support Design library too which started from API 9. It's most prefer solution for me, because it allows to get only one apk for API 9-30 with Material Design which working great from API 9 to API 30, because 25.4.0 was released in June 2017 and base methods are not changing even in API 30. BTW I don't see any seriosly updated in the new support library versions to raise my min API version to 14 and of course up.

这篇关于如何支持API级别&lt;14吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆