2017-09-04 47 views
0

Previously Asked Question无法安装Cardview存储库

我无法安装Cardview支持存储库。 Gradle认识到我需要它安装并出现以下错误。但我不能点击安装库并进行同步。相反,我可以点击它,但是我没有任何反应。

Picture of error 我的应用摇篮文件

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.0" 
    defaultConfig { 
     applicationId "pro.bladebeat.projectpsittacosaurus" 
     minSdkVersion 19 
     targetSdkVersion 25 
     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(dir: 'libs', include: ['*.jar']) 
    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:25.3.1' 
    compile 'com.android.support:cardview-v7.25.0.0' 
    compile 'com.android.support:recyclerview-v7:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.1' 
    compile 'com.android.support:design:25.3.1' 

testCompile '的JUnit:JUnit的:4.12' }

我的项目摇篮文件

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.3.3' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url "https://maven.google.com" 
     } 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 
+3

'compile'c​​om.android.support中的可能的拼写错误:cardview-v7.25.0.0''。使用'compile'c​​om.android.support:cardview-v7:25.0.0''而不是 –

+2

1)绝对是错字。 2)所有版本的支持库需要匹配 –

+0

耶稣它的小东西。错字是问题。 Ajil或Cricket,作为回答后张贴 –

回答

1

使用compile 'com.android.support:cardview-v7:25.3.1'代替compile 'com.android.support:cardview-v7.25.0.0'

这将解决这个错字,以及符合您正在使用的支持库的版本(如cricket_007指出)。

0

去你的Android SDK管理器和然后在SDK Manager中安装/更新“Android支持库”。 它会找到依赖关系。

+1

它会一旦错字是固定的 –