如何忽略库的minSdkVersion Android Studio中? [英] How do I ignore minSdkVersion of library in Android Studio?

查看:1228
本文介绍了如何忽略库的minSdkVersion Android Studio中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目的minSdkVersion = 10,在图书馆是11

In my project minSdkVersion = 10, in the library it's 11.

我得到:

BUILD_FAILED - Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version 11 declared in library.

如何无视图书馆的minSdkVersion?

How to ignore minSdkVersion of library?

推荐答案

您需要将项目更改为图书馆的价值 11 ,因为该属性意味着库的目的是要在至少有11 API不支持API 10在所有设备上使用,所以你不能用它根据要求和项目的最低SDK。请参阅有关&LT的更多详细信息;使用-SDK>

You need to change your project to library's value 11, because that attribute means that library was designed to be used at devices at least with API 11. It does not support API 10 at all, so you can not use it according requirements and minimal SDK of your project. See more details about < uses-sdk >

查找,这将支持另一个库API 10

Find another library which will support API 10

更新:

使用ManifestMerger的力量。从官方网站

Use power of ManifestMerger. From official site.

段落 标记

Paragraph Markers

工具:overrideLibrary标记

这只能使用-SDK声明中使用覆盖导入库,最小的SDK版本比该应用程序的最低SDK版本更新的特殊标记。
如果没有这样的标记,清单合并将失败。标记将允许用户选择哪些库可以导入忽略的最低SDK版本。

A special marker that can only be used with uses-sdk declaration to override importing a library which minimum SDK version is more recent than that application's minimum SDK version. Without such a marker, the manifest merger will fail. The marker will allow users to select which libraries can be imported ignoring the minimum SDK version.

例如,在主要Android清单:

Example, In the main android manifest :

<uses-sdk android:targetSdkVersion="14" android:minSdkVersion="2"
      tools:overrideLibrary="com.example.lib1, com.example.lib2"/>

将允许库与下列清单无错误地进行输入:

will allow the library with the following manifest to be imported without error :

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.lib1">
    <uses-sdk android:minSdkVersion="4" />
</manifest>

这篇关于如何忽略库的minSdkVersion Android Studio中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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