Android gradle配置强制使用引用库版本

在开发过程中我们经常遇到引用的几个库中引用的相同的库版本不一致,那么就会出现版本的冲突,我们需要统一使用引用库的版本,所以我们应该对齐进行统一强制版本引用控制,如下:

def supportVersion = "27.1.1" //这里是版本定义


configurations.all {
    resolutionStrategy {
        force "com.android.support:recyclerview-v7:supportVersion"
        force "com.android.support:appcompat-v7:supportVersion"
        force "com.android.support:support-v4:supportVersion"
        force "com.android.support:design:supportVersion"
        force "com.android.support:support-vector-drawable:$supportVersion"
    }
}
0 0 vote
Article Rating
Subscribe
提醒
guest
0 评论
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x