如何找出每个包含库的最小API级别 [英] How to find out min api level of each included library

查看:85
本文介绍了如何找出每个包含库的最小API级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中包含了很多库(Android Studio 2.0 Preview 4).我想找出它们各自的最低Android SDK级别.是否可以不使用谷歌搜索每个图书馆的信息?

I have a lot of libraries included into the project (Android Studio 2.0 Preview 4). I want to find out min Android SDK level of each of them. Is it possible without googling info about every library?

推荐答案

如果您具有源形式的库(例如,作为项目中的库模块),请查看其清单.

If you have the library in source form (e.g., as a library module in your project), look at its manifest.

如果您具有AAR格式的库,那只是一个ZIP文件,因此请在其中查看并检查其清单,或者在下一段中使用该技术.

If you have the library in AAR form, that's just a ZIP file, so look inside it and examine its manifest, or use the technique in the next paragraph.

如果您将库用作AAR,但通过存储库中的工件,则爆炸的AAR"将出现在您的build/输出中.对于app模块,请在app/build/intermediates/exploded-aar/中查找那些AAR.将存在基于组ID,工件ID和版本的子目录.在其中,您将找到AndroidManifest.xml文件.即使原始库的源代码的build.gradle中有minSdkVersion,在AAR中(以及在exploded-aar/中)生成的AndroidManifest.xml也应该在其中包含minSdkVersion.

If you have the library as an AAR but via an artifact from a repository, the "exploded AAR" will be in your build/ output. For an app module, look in app/build/intermediates/exploded-aar/ for those AARs. There will be subdirectories based on group ID, artifact ID, and version. In there, you will find the AndroidManifest.xml file. Even if the original library's source had the minSdkVersion in its build.gradle, the generated AndroidManifest.xml in the AAR (and in exploded-aar/) should have the minSdkVersion in there.

如果该库只是一个JAR,您将不得不阅读文档,因为该工具链不了解最低SDK,因此无法执行.

If the library is just a JAR, you're stuck with reading documentation, as the toolchain has no knowledge of a minimum SDK and cannot enforce it.

这篇关于如何找出每个包含库的最小API级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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