2017-01-28 1 views
0

최근 mindSdkVersion을 17로 변경하고 targetSdkVersion을 21로 변경하여 많은 오류가 발생했습니다. 나는 그들 중 일부를 수정,하지만 난이 하나를 해결할 수 없습니다 내가 Mac에서 안드로이드 Studio를 사용하고 있는데 나는 안드로이드 지원 저장소를해결 실패 : com.android.support:appcompat-v7:21.0.1

Error:(28, 13) Failed to resolve: com.android.support:appcompat-v7:21.0.1 

.

내 build.gradle 파일 :

apply plugin: 'com.android.application' 


android { 
    compileSdkVersion 21 
    buildToolsVersion "24.0.3" 
    defaultConfig { 
     applicationId "com.swit.sedamaker" 
     minSdkVersion 17 
     targetSdkVersion 21 
     versionCode 2 
     versionName "1.01" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    productFlavors { 
    } 
} 

dependencies { 

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

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

    testCompile 'junit:junit:4.12' 
} 

답변

0

가 교체보십시오 : 지원 라이브러리에 대한 21.0.1이 존재하지 않기 때문에

compile 'com.android.support:appcompat-v7:23.3.0' 
+0

나는 여전히 오류가 발생합니다. –

+0

@AmirAmini, 21에서'targetSdkVersion 21'을 계속 유지하려고합니다. – W4R10CK

+0

23 덕분에 업그레이드하려고했습니다. 다른 오류가 있었지만 수정했습니다. 하지만 지금은 에뮬레이터에 설치할 수 없습니다. 그것은 거기에 내 애플 리케이션의 다른 버전이 설치되어 있지만이 에뮬레이터에서 내 애플 리케이션을 실행하고있어 처음이야. –

0

오류가 발생합니다. 당신은 더 나은 것

dependencies{ 

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

} 
0

compileSdkVersion, buildToolsVersion, targetSdkVersion의 API 버전과 일치합니다.

이 플러그인을 적용 최신 SDK를 사용해보십시오 : 당신이 원하는 경우에 당신이 21 targetSdkVersion을 설정할 수 있습니다 물론 'com.android.application'

android { 
    compileSdkVersion 24 
    buildToolsVersion "24.0.3" 
    defaultConfig { 
     ... 
     minSdkVersion 17 
     targetSdkVersion 24 
     ... 
    } 
    ... 
} 

dependencies { 

    compile 'com.android.support:appcompat-v7:24.2.0' 
    ... 
} 

합니다. targetSdkVersion은 documentation과 같은 대상 버전에 대해 앱을 테스트했음을 시스템에 알리는 데 사용됩니다.

안드로이드 : targetSdkVersion을

은 API 수준 응용 프로그램의 대상을 지정하는 정수입니다. 설정되지 않은 경우 기본값은 에서 minSdkVersion으로 지정된 값과 같습니다. 이 속성은 시스템에 사용자가 을 대상 버전에 대해 테스트했음을 시스템에 알리고 시스템에서 호환성 동작을 활성화하여 앱의 정방향 호환성을 대상 버전으로 유지하지 않아야합니다. 응용 프로그램은 이전 버전에서 실행할 수 있습니다 (minSdkVersion까지).

compileSdkVersiontargetSdkVersion에 대한 자세한 내용은 What is the difference between compileSdkVersion and targetSdkVersion?을 참조하십시오.

관련 문제