Nice programing

com.android.support:appcompat-v7:22 및 com.android.support:recyclerview-v7:21.1.2를 해결하지 못했습니다.

nicepro 2020. 12. 27. 20:45
반응형

com.android.support:appcompat-v7:22 및 com.android.support:recyclerview-v7:21.1.2를 해결하지 못했습니다.


compileSdkVersion 22를 21 buildToolsVersion '22 .0.1 '에서 21.1.2로 변경했지만 오류를 포함하여 ALL Extra 및 SDK API 21-22를 설치했습니다.

그리고 API 22의 렌더링 문제와 나는 여전히 <= 21로 변경되었습니다.


API 요구 사항에 따라 build.gradle에 추가 할 수있는 올바른 버전입니다.

API 24 :

implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:recyclerview-v7:24.2.1'

API 25 :

implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:recyclerview-v7:25.4.0'

API 26 :

implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'

API 27 :

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'

그 작업을 수행하기 위해 나는 설정해야했습니다.

compile ("com.android.support:support-v4:22.2.0")
compile ("com.android.support:appcompat-v7:22.2.0")
compile ("com.android.support:support-annotations:22.2.0")
compile ("com.android.support:recyclerview-v7:22.2.0")
compile ("com.android.support:design:22.2.0")

컴파일 ( "com.android.support : design : 22. 2 .0")

문서에 다른 내용이 나와 있습니다 ( docs ).

com.android.support : 지원 -design : 22. 0 .0


지원 리포지토리 라이브러리의 실제 경로 :

여기에 이미지 설명 입력

  1. Support Repository Libraries를 다운로드해야합니다.

문제가 여전히 존재하는 경우 :

  1. 지원 리포지토리 라이브러리의 실제 경로로 이동하여 다음 폴더가 있는지 확인합니다.

    "ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support" 
    

    그 폴더에는 찾을 수없는 지원 라이브러리가 있습니다. 예를 들면 :

    "ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support\appcompat-v7"
    
  2. 폴더를 열면 appcompat-v7사용 가능한 모든 버전의 폴더가 표시됩니다. build.gradle 파일 종속성에서 이러한 버전 중 하나만 사용하거나 예를 들어 +를 사용해야합니다. 18.0. +

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:18.0.+'
        compile 'com.android.support:gridlayout-v7:23.1.1'
        compile 'com.android.support:support-v4:23.1.1'
    }
    

이는 grade.build 종속성 파일에서 가져온 경로입니다.

com.android.support:appcompat-v7:18.0.0

HDD의 실제 경로를 참조하십시오->

ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support\appcompat-v7\18.0.0

이러한 폴더가 없으면 다음 오류가 표시됩니다.

"failed to resolve com.android.support:appcompat-v7:18.0.0"  

ps Windows x64가있는 경우 sdk 및 jdk를 설치할 때 설치 경로에 Program Files(86). Windows를 추가하는 대괄호는 프로젝트의 경로를 확인하는 데 추가 문제를 일으킬 수 있습니다. 설치 폴더에 간단한 경로를 사용하십시오.

예를 들면 :

c:\androidSDK\

찾기 실패 : com.android.support:appcompat-v7:22.0.0

"말 그대로 다른 모든 것을 시도했습니다"답변 :

이 문제는 최신 Android 지원 라이브러리 및 Android 지원 저장소가없는 경우에도 발생합니다. SDK 관리자를 사용하여 설치하십시오.


제공된 다른 솔루션과 함께 project / build.gradle 내에 다음이 있는지 확인하십시오.

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

지원 라이브러리에서는 항상 버전 번호로 3 개의 숫자를 추가해야합니다.

22-> 22가 아니라 22.0.0으로 작성해야한다고 가정합니다.

22.1-> 22.1.0의 경우

따라서 종속성은 다음과 같아야합니다.

compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:cardview-v7:22.0.0'
compile 'com.android.support:recyclerview-v7:22.0.0'

나는 여분의 0을 채우는 데 필요한 프로그래머 언어입니다.

이것이 문제를 해결하기를 바랍니다.


나는 그것을 해결한다

22.0.0에서 21.0.3으로 변경

dependencies {

 compile fileTree(dir: 'libs', include: ['*.jar'])

//compile 'com.android.support:appcompat-v7:22.0.0'

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

아마도 나는 다운로드 com.android.support:appcompat-v7:21.0.3했지만 얻지 못했습니다compile 'com.android.support:appcompat-v7:22.0.0'

SDK Manager를 사용하면 support library및을 업데이트 support repository하면 문제가 사라집니다.


NOTE1: All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes).

NOTE2: Support library should not use a different version than the compileSdkVersion

For API 28 you can use:

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'

https://mvnrepository.com/artifact/com.android.support/appcompat-v7/28.0.0-alpha1 https://mvnrepository.com/artifact/com.android.support/recyclerview-v7/28.0.0-alpha1

All support libraries: https://mvnrepository.com/artifact/com.android.support


It is easier to use "+" sign in the version number. For example

compile 'com.android.support:support-v4:22.0.+'
compile "com.android.support:appcompat-v7:22.0.+"

In this case you won't have to change versions for the same API number


Go to Messages Gradle Sync, and Click on Install Repository and sync project. This is will install needed file in Android SDK and after syncing you will be able to create gradle or run your project.


Are you import them? Like this:

compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'

compile ("com.android.support:support-v4:22.2.0")
compile ("com.android.support:appcompat-v7:22.2.0")
compile ("com.android.support:support-annotations:22.2.0")
compile ("com.android.support:recyclerview-v7:22.2.0")
compile ("com.android.support:design:22.2.0")

paste the above code in your app gradle.

and while setting up the project select empty activity instead of blank activity.


Fixed my issue by changing these

compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'

to

compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.android.support:recyclerview-v7:23.0.+'

that means your target SDK version should be same as version of cardView and recyclerView and other google libraries.

targetSdkVersion 23

Tools > Android > SDK Manager

Select all of the packages that are not up to date and update them.


I had such dependancy in build.gradle -

compile 'com.android.support:recyclerview-v7:+'

But it causes unstable builds. Ensure it works ok for you, and look in your android sdk manager for current version of support lib available, and replace this dependency with

def final RECYCLER_VIEW_VER = '23.1.1'
compile "com.android.support:recyclerview-v7:${RECYCLER_VIEW_VER}"

Android SDK Manager에서 모든 패키지를 업데이트하는 문제를 해결했으며 Extras -> Android Support Repository.


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

참조 URL : https://stackoverflow.com/questions/29284236/failed-to-resolve-com-android-supportappcompat-v722-and-com-android-supportre

반응형