如何确保没有"v7应用程序兼容或支持"冲突?任何应用程序使用我的库时我的库的地址? [英] How do make sure there is no conflict of "v7 appcompat or support" of my library when any application uses my library?

查看:84
本文介绍了如何确保没有"v7应用程序兼容或支持"冲突?任何应用程序使用我的库时我的库的地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gradle中有一个具有com.android.support:appcompat-v7:23.0.1依赖关系的android库.

I have a android library with com.android.support:appcompat-v7:23.0.1 dependency in the gradle.

说任何具有不同版本com.android.support:appcompat-v7:23.3.0的应用程序都在该版本中.该应用程序的gradle使用我的库.

Say any applicaion with different version com.android.support:appcompat-v7:23.3.0is in the build.gradle of that application uses my library.

下面是我有疑问的问题列表.

Below are the list of questions I have doubt.

  1. android使用哪个版本?低一或高一?我怎么看?

  1. which version does the android take? Lower one or Higher one? How do i see it?

如果我使用24或25或更高版本或相同的其他版本,不会有任何冲突吗?

Won't there be any conflict if i use different version like 24 or 25 and above or same?

当任何应用使用我的库时,如何确保v7 appcompat没有冲突?

How do i make sure there is no conflict of v7 appcompat when any app uses my library?

推荐答案

  1. android使用哪个版本?低一或高一?我怎么看?

等级使用较高等级.
您可以使用命令gradlew dependencies来检查依赖关系树.

Gradle uses the higher one.
You can use the command gradlew dependencies to check the dependencies tree.

  1. 如果我使用不同的版本(例如24或25及更高版本或相同版本),会不会有冲突?
  2. 当任何应用使用我的库时,如何确保v7 appcompat不存在冲突?

通常,维护库并避免冲突的最佳方法是始终使用最新的支持库来更新库.

In general the best way to maintain a library and to avoid the conflicts is to update the library always with the latest support libraries.

如果应用程序的compiledSDK在appcompat-v7:23.3.0中为23,而库的应用程序的SDK在appcompat-v7:24+中为24,该怎么办? android需要哪些支持库?

What if the compiledSDK of application is 23 with appcompat-v7:23.3.0 and and that of the library is 24 with appcompat-v7:24+. Which all support libraries does the android take?

如果您的图书馆使用支持库v24,则该图书馆和该应用将需要使用相同的级别= 24进行编译.

If your library uses support libraries v24, the library and the app will require to be compiled with the same level = 24.

这篇关于如何确保没有"v7应用程序兼容或支持"冲突?任何应用程序使用我的库时我的库的地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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