尝试构建应用程序,每次与Gradle同步时,我都会遇到相同的3个错误

时间:2015-06-04 22:04:36

标签: android android-gradle

一个说,错误:配置项目':app'时出现问题。

Could not resolve all dependencies for configuration ':app:_debugCompile'.
   Could not find com.android.support:appcompat-v7:21.1.2.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.pom
         https://jcenter.bintray.com/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.jar

     file:/C:/Users/Richard/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.pom
     file:/C:/Users/Richard/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.jar
     file:/C:/Users/Richard/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.pom
     file:/C:/Users/Richard/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.jar
 Required by:
     MyApplication:app:unspecified

另一个说:

Error:(28, 13) Failed to resolve: com.android.support:appcompat-v7:21.1.2
<a href="install.m2.repo">Install Repository and sync project</a><br><a href="openFile">Show in File</a><br><a href="open.dependency.in.project.structure">Show in Project Structure dialog</a>

1 个答案:

答案 0 :(得分:1)

Appcompat v 21.1.2不存在。

检查here版本。

您可以使用:

您可以使用以下方法之一:

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'
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'