无法解决:com.android.support:support-compat:25.0.1。?

时间:2016-12-29 07:09:33

标签: android android-gradle

添加依赖项时,我无法找出确切的问题。

 dependencies {
    compile 'com.github.jetradarmobile:android-snowfall:1.1.2'
}

我收到上述错误

 my Gradle(Project)


     buildscript {
         repositories {
             jcenter()
         }
         dependencies {
             classpath 'com.android.tools.build:gradle:2.2.1'
         }
     }
     allprojects {
         repositories {
             jcenter() {
                 maven { url "https://jitpack.io" }
             }
         }
     }
     task clean(type: Delete) {
         delete rootProject.buildDir
     }

我的Gradle(应用程序)

     apply plugin: 'com.android.application'

     android {
         compileSdkVersion 24
         buildToolsVersion "24.0.3"
         defaultConfig {
             applicationId "com.animationbook.animationbook"
             minSdkVersion 15
             targetSdkVersion 24
             versionCode 1
             versionName "1.0"
             testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
         }
         buildTypes {
             release {
                 minifyEnabled false
                 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
             }
         }
     }
     dependencies {
         compile fileTree(include: ['*.jar'], dir: 'libs')
         androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
             exclude group: 'com.android.support', module: 'support-annotations'
         })
         compile 'com.android.support:appcompat-v7:24.2.1'
         debugCompile 'junit:junit:4.12'
         compile 'com.github.moondroid.coverflow:library:1.0'
         compile 'com.github.jetradarmobile:android-snowfall:1.1.2'
     }

如何解决错误?

4 个答案:

答案 0 :(得分:4)

这是因为你的依赖关系com.github.jetradarmobile:android-snowfall:1.1.2compileSdkVersion 25buildToolsVersion "25.0.2"& com.android.support:support-compat:25.0.1

因此,您需要将com.android.support:appcompat-v7:24.2.1更改为com.android.support:appcompat-v7:25.1.0,将buildToolsVersion更改为25.0.1com.android.support:design:25.1.0

如果您不想更改buildToolsVersion,则可以使用它的模块并更改模块buildToolsVersion

答案 1 :(得分:3)

我遇到了同样的问题,而我所做的就是更新" Google Repository"和#34; Android支持存储库"在Android SDK Manager中。

我希望它有所帮助!

答案 2 :(得分:2)

更改buildToolsVersion to 25.0.1并添加依赖项compile 'com.android.support:design:25.1.0'

并将compile 'com.android.support:appcompat-v7:24.2.1'更改为compile 'com.android.support:appcompat-v7:25.1.0'

答案 3 :(得分:0)

我面临着同样的问题。

  

我刚刚更新了所有支持lib版本,并且错误消失了!!!