2015-09-19 29 views
6

Khi tôi cố gắng biên dịch dự án android iam của mình nhận được lỗi sau.Không thể biên dịch dự án android của tôi

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 

Đây là nộp Gradle tôi

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

một số ai có thể giúp tôi để sửa lỗi này cảm ơn bạn.

+2

Nó không thể tìm thấy thư viện AppCompat và Recyclerview. Bạn đã cài đặt chúng chưa. Đảm bảo bạn đã cài đặt các phiên bản giống như bạn nói trong tệp của mình. Bạn có thể cài đặt phiên bản mới nhất từ ​​SDK Manager là 23.0.1 – Sharj

Trả lời

7

Nó xảy ra vì 21.0.1đối với thư viện hỗ trợkhông tồn tại.

Bạn có thể sử dụng trong build.gradle một trong những:

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' 

} 

Việc xem xét cùng là hợp lệ cũng cho com.android.support:recyclerview-v7

1

Tôi nghĩ đường dây buildToolsVersion "23.0.0 rc2" đang gây ra sự cố.

thay đổi nó để buildToolsVersion "21.0.1"

hoặc thử

compileSdkVersion 21 
buildToolsVersion "22.0.1" 

compile 'com.android.support:appcompat-v7:22.2.0' 

và có gì sharj đã nói cũng đúng, bạn có thể thiếu công cụ xây dựng

8

tôi phải đối mặt với vấn đề tương tự và cài đặt SDK Android xây dựng công cụ -v23.0.1 và gọi Android hướng dẫn thiết lập https://facebook.github.io/react-native/docs/android-setup.html#content

nhưng không thể định vị "kho lưu trữ hỗ trợ Android", phiên bản mới nhất của trình quản lý SDK- tùy chọn được thay đổi thành "Kho lưu trữ maven cục bộ để hỗ trợ librar ".

enter image description here

+1

Điều này giải quyết được vấn đề của tôi, nhưng tính đến ngày 15/7/2016, nó được đổi tên thành "Kho lưu trữ hỗ trợ Android" –

Các vấn đề liên quan