Com.android.support of conflict resolution

Source: Internet
Author: User

Tag: version represents the Ring Ash project using the Resolve support provided

All Com.android.support libraries must use the exact same version specification (mixing versions can leads to runtime crash Es

When we use Android Studio to add some third-party dependent libraries, we are likely to be prompted for this error.

The general meaning is com.android.support the package version number to be consistent, but may be our own new Project Com.android.support package version number is higher, some third-party library com.android.support may not update the support library in time , this error will occur.

Workaround (The same applies to other dependency conflicts.) )
1) Modify the version number of the Com.android.support in your project to match the version number of the library you rely on, but not when the Com.android.support version number in the library we rely on has several versions. (Not recommended)

2) Recommend this method, if there is a conflict, rely on the third-party library to eliminate the dependency on the Com.android.support package, so that their own project depends on any version can be.

Group: Excludes all that is included as Com.android.support
The API is a new way to rely on Android studio3.0, you can read this article: Android Studio3.0 new dependency mode

For example:

    api("冲突的依赖") {        exclude group: ‘com.android.support‘    }

Module: Remove the specified module from the group
For example:

    api("冲突的依赖") {        exclude group: ‘com.android.support‘, module: ‘support-v13‘        exclude group: ‘com.android.support‘, module: ‘support-vector-drawable‘ }

There is also a suggestion that when we create a library for others to use, if we need to rely on com.android.support, it is recommended to rely on the provided way (Android studio3.0 to compileonly) so that it is only valid at compile time and will not be involved in packaging. To avoid inconvenience to the user.

Cases:

    ‘com.android.support:appcompat-v7:26.1.0‘    provided ‘com.android.support:design:26.1.0‘    provided ‘com.android.support:support-vector-drawable:26.1.0‘

Well, that's all, I hope I can help you.

Com.android.support of conflict resolution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.