Android 强制执行'appcompat-v7:24.0.3'会发出错误消息

Android 强制执行'appcompat-v7:24.0.3'会发出错误消息,android,android-layout,android-fragments,gradle,android-gradle-plugin,Android,Android Layout,Android Fragments,Gradle,Android Gradle Plugin,我已经在我的项目中使用了appcompat-v7:24.0.3,但是当我强制使用它时,它会给我以下错误消息 错误:(73,19)无法解决: com.android.support:appcompat-v7:24.0.3安装存储库和同步项目 我尝试单击Install Repository,但它已经安装。所以它在点击时什么也不做。我正在使用以下解决方案策略 configurations.all { resolutionStrategy { /* resolutionStrate

我已经在我的项目中使用了
appcompat-v7:24.0.3
,但是当我强制使用它时,它会给我以下错误消息

错误:(73,19)无法解决: com.android.support:appcompat-v7:24.0.3安装存储库和同步项目
我尝试单击Install Repository,但它已经安装。所以它在点击时什么也不做。我正在使用以下
解决方案策略

configurations.all {
    resolutionStrategy {
       /* resolutionStrategy.failOnVersionConflict()*/
        force 'com.android.support:cardview-v7:24.1.1'
        force 'com.android.support:design:24.1.1'
        force 'com.android.support:appcompat-v7:24.0.3'
        force 'com.android.support:support-v4:24.1.1'
        force 'com.google.android.gms:play-services-ads:9.0.1'
        force 'com.google.android.gms:play-services-location:9.0.1'
        force 'com.android.support:recyclerview-v7:24.0.3'
    }
}
如果我转到旧版本,并使用这些,它不会给出任何错误消息

    force 'com.android.support:appcompat-v7:23.3.0'
    force 'com.android.support:support-v4:23.3.0'
    force 'com.google.code.gson:gson:2.6.1'
    force 'com.android.support:recyclerview-v7:23.3.0'
如果我删除force并只使用compile,它不会给出任何错误消息

错误:(73,19)未能解析:com.android.support:appcompat-v7:24.0.3安装存储库和同步项目

发生这种情况是因为appcompat-v7:24.0.3不存在。

您可以:

修订档案:

25.1.1
25.1.0
25.0.1
25.0.0
24.2.1
24.2.0
24.1.1
24.1.0
24.0.0
23.4.0
23.3.0
还应使用相同级别的支持库,例如:

   force 'com.android.support:appcompat-v7:24.1.1'

谢谢,让我试试看,但我不知道为什么不用武力,只用
compile
关键字就可以了