- what version does android do? Lower or Higher? How to see it?
When creating a library, you explicitly set the dependency in build.gradle . The creator of the application does the same, which uses your library as a dependency declared in its build.gradle . If the creator explicitly declares the support library as a dependency, that version is taken (regardless of the versions declared by the dependencies). If he does not, the highest version declared by any dependency is accepted (such a support library is considered as a transitive dependency).
Example: Your library uses appcompat-v7:23.3.0 . The creator of the application is declared appcompat-v7:25.0.1 . Simple case: appcompat-v7:25.0.1 is taken.
Example 2: Your library uses appcompat-v7:23.3.0 . The creator of the application does not use appcompat-v7 . appcompat-v7:23.3.0 will be in the application output.
Example 3: Your library uses appcompat-v7:23.3.0 . Another library uses appcompat-v7:24.1.0 . If the creator does not explicitly declare appcompat-v7:xx.xx , the version of appcompat-v7:24.1.0 will be in the output application.
I hope you understand.
- How can I make sure that there is no v7 application conflict when any application uses my library?
You cannot assure this. That is why you should always put the highest version of the support libraries in the library. I can’t even assure that the support libraries support backward compatibility. Here is an example that they do not have.
I know that the support library should not use a different version than compileSdkVersion.
This is just an assumption. However, you must comply with it, but you do not need.
source share