无法编译我的android项目 [英] Unable to compile my android project

查看:203
本文介绍了无法编译我的android项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 错误:配置项目出现问题':应用。 
无法解析配置':app:_debugCompile'的所有依赖关系。
找不到com.android.support:appcompat-v7:21.0.1。
在以下位置搜索:
https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar
file:/ home / baman / Android / Sdk / extras /android/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom
file:/ home / baman / Android / Sdk / extras / android / m2repository / com /android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar
file:/ home / baman / Android / Sdk / extras / google / m2repository / com / android / support / appcompat -v7 / 21.0.1 / appcompat-v7-21.0.1.pom
文件:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.1 /appcompat-v7-21.0.1.jar
所需者:
SriLankaTemples:app:unspecified
无法找到com.android.support:recyclerview-v7:21.0.1。
在以下位置搜索:
https://jcenter.bintray.com/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.pom
https://jcenter.bintray.com/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.jar
file:/ home / baman / Android / Sdk / extras /android/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.pom
file:/ home / baman / Android / Sdk / extras / android / m2repository / com /android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.jar
文件:/ home / baman / Android / Sdk / extras / google / m2repository / com / android / support / recyclerview -v7 / 21.0.1 / recyclerview-v7-21.0.1.pom
文件:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/recyclerview-v7/21.0.1 /recyclerview-v7-21.0.1.jar
要求:
SriLankaTemples:app:未指定

这是我的Gradle文件

  apply plug in:'com.android.application'

android {
compileSdkVersion 19
buildToolsVersion23.0.0 rc2

defaultConfig {
applicationIdlk.lankahomes.baman.srilankatemples
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName1.0
}
buildTypes {
$ {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
}

依赖关系{
编译fileTree(包括:['* .jar'],dir:'libs')
编译'com.android.support:appcompat-v7:21.0.1'
compile'c​​om.android.support:recyclerview-v7:21.0.1'
}

可以帮助我解决这个问题。谢谢。 这是因为 21.0。 1 为su pport库 不存在



您可以在 build.gradle 其中之一:

 依赖关系{

//它需要compileSdkVersion 23
compile'c​​om.android.support:appcompat-v7:23.2.0'
compile'c​​om.android.support:appcompat-v7:23.1.1'
compile'c​​om.android.support:appcompat -v7:23.1.0'
compile'c​​om.android.support:appcompat-v7:23.0.1'
compile'c​​om.android.support:appcompat-v7:23.0.0'

//它需要compileSdkVersion 22
编译'com.android.support:appcompat-v7:22.2.1'
compile'c​​om.android.support:appcompat-v7:22.2.0 '
compile'c​​om.android.support:appcompat-v7:22.1.1'
compile'c​​om.android.support:appcompat-v7:22.1.0'
compile'c​​om.android .support:appcompat-v7:22.0.0'

//它需要compileSdkVersion 21
编译'com.android.support:appcompat-v7:21.0.3'
compi le'com.android.support:appcompat-v7:21.0.2'
compile'c​​om.android.support:appcompat-v7:21.0.0'

}

同样的考虑也适用于 com.android.support:recyclerview-v7


When i try to compile my android project iam getting the following error.

  Error:A problem occurred configuring project ':app'.
  Could not resolve all dependencies for configuration ':app:_debugCompile'.
  Could not find com.android.support:appcompat-v7:21.0.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom
         https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar
         file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom
         file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar
         file:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom
         file:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar
     Required by:
         SriLankaTemples:app:unspecified
   Could not find com.android.support:recyclerview-v7:21.0.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.pom
         https://jcenter.bintray.com/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.jar
         file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.pom
         file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.jar
         file:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.pom
         file:/home/baman/Android/Sdk/extras/google/m2repository/com/android/support/recyclerview-v7/21.0.1/recyclerview-v7-21.0.1.jar
     Required by:
         SriLankaTemples:app:unspecified

Here is my Gradle file

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "23.0.0 rc2"

    defaultConfig {
        applicationId "lk.lankahomes.baman.srilankatemples"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:21.0.1'
    compile 'com.android.support:recyclerview-v7:21.0.1'
}

can some one help me to fix this thank you.

解决方案

It happens because the the 21.0.1 for support libraries doesn't exist.

You can use in build.gradle one of these:

dependencies{

  //it requires compileSdkVersion 23
  compile 'com.android.support:appcompat-v7:23.2.0'
  compile 'com.android.support:appcompat-v7:23.1.1'
  compile 'com.android.support:appcompat-v7:23.1.0'
  compile 'com.android.support:appcompat-v7:23.0.1'
  compile 'com.android.support:appcompat-v7:23.0.0'

  //it requires compileSdkVersion 22
  compile 'com.android.support:appcompat-v7:22.2.1'
  compile 'com.android.support:appcompat-v7:22.2.0'
  compile 'com.android.support:appcompat-v7:22.1.1'
  compile 'com.android.support:appcompat-v7:22.1.0'
  compile 'com.android.support:appcompat-v7:22.0.0'

  //it requires compileSdkVersion 21
  compile 'com.android.support:appcompat-v7:21.0.3'
  compile 'com.android.support:appcompat-v7:21.0.2'
  compile 'com.android.support:appcompat-v7:21.0.0'

}

The same consideration is valid also for the com.android.support:recyclerview-v7

这篇关于无法编译我的android项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆