Program Tip

해결 실패 : com.android.support.design:25.4.0

programtip 2020. 12. 2. 21:44
반응형

해결 실패 : com.android.support.design:25.4.0


내 build.gradle (Module : app)에 다음 줄을 추가했습니다.

compile 'com.android.support:design:25.4.0' 

하지만 Gradle을 실행할 때

Failed to resolve: com.android.support.design:25.4.0

Android 지원 디자인 라이브러리 에서 지원 코드를 가져 와서 새 프로젝트에 추가했습니다. 다음과 같이 종속성 섹션에 추가했습니다.

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:design:25.4.0'
}

내가 뭘 잘못하고 있는지에 대한 아이디어가 있습니까?


중요 : 이제 Google의 Maven 저장소를 통해 지원 라이브러리를 사용할 수 있습니다. SDK Manager에서 지원 저장소를 다운로드 할 필요가 없습니다. 자세한 내용은 지원 라이브러리 설정을 참조하십시오 .

1 단계 : 애플리케이션의 build.gradle 파일을 엽니 다.

2 단계 : 저장소 섹션에 " https://maven.google.com "엔드 포인트가 있는 maven 섹션이 포함되어 있는지 확인 합니다. 예를 들면 :

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

3 단계 : 종속성 섹션에 지원 라이브러리를 추가합니다. 예를 들어 v4 core-utils 라이브러리를 추가하려면 다음 줄을 추가합니다.

dependencies {
    ...
    compile "com.android.support:support-core-utils:25.4.0"
}

"Bhavesh Patadiya" 의 답변의 업데이트 된 버전 :

  1. 프로젝트 build.gradle 파일 google()에서 repositories블록에 추가 하십시오 .

    repositories {
        jcenter()
        google()
    }
    
  2. 최신 Gradle 버전으로 동일한 파일을 업데이트합니다.

    classpath 'com.android.tools.build:gradle:2.3.3'
    
  3. 위의 사항으로 인해 새로운 문제 또는 동일한 문제가 발생하면 Android-Studio를 종료하고 "gradle"폴더 ( ".gradle"폴더 일 수도 있음)와 "build"폴더 및 하위 폴더를 삭제 한 다음 Android를 엽니 다. -다시 스튜디오.


allprojects {
repositories {
    google()
    jcenter()
    mavenCentral()
}
}

Mr. Bhavesh Patadiya는 우리에게 좋은 해결책을 제시합니다. 그러나 수정 프로세스를 더 명확하게 만들기 위해 더 많은 것을 공유하고 싶습니다.

프로젝트 디렉토리 아래에 두 개의 "build.gradle"파일이 있습니다. 경로는 각각 "Your-project-root-dir / build.gradle"및 "Your-project-root-dir / app / build.gradle"입니다. Android 스튜디오에서 오류 정보를보고 파일을 추적하려고하면 두 번째 파일을 열 수 있습니다.

첫 번째 파일 ( "Your-project-root-dir / build.gradle")에이 문을 추가해야합니다.

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

두 번째 build.gradle ( "Your-project-root-dir / app / build.gradle")에 문을 추가합니다.

dependencies {
    ...
    compile "com.android.support:support-core-utils:27.0.2"
}

항상 appcompact버전을 유지 하고 lib 버전을 동일하게 지원하므로 다음 com.android.support:design:25.4.0으로 변경하십시오 .com.android.support:design:25.3.1


You need to update the android support Repository in the SDK manager . Also the Design Library depends on the Support v4 and AppCompat Support Libraries.

Same version android support must be the same with others..

compile 'com.android.support:appcompat-v7:25.3.1'  <-- same
compile 'com.android.support:design:23.3.1'  <-- same

This problem occurs when there is andoridtestImplementation is added in app.build.

Remove testImplementation,androidTestImplementation from the app.build, that solves this issue.


Above answers did't resolve anything for me.

  • Tried syncing the project- Failed.
  • Tried building the project -Failed

Problem found :

Sdk Support Repository was corrupted

.

Fix:

Go to the SDK manager, click the "SDK Tools" tab. If the check-mark for "Support Repository" is selected, unselect it and click OK. This will delete all of the files in the repository. Then recheck the check-mark, click GO and reinstall the repository.


If you still have the issue, check the project settings for offline mode. if offline mode is on, then off and sync the project. That fixed my issue.


after adding :

maven {
    url "https://maven.google.com"
}

make sure your Gradle sync is on ONLINE mode you can check it from:

Android studio -> Preferences -> Build, Execution, Deployment -> Gradle -> Offline work (make sure this check box is not selected)


There is no library by that name. There is com.android.support:recyclerview-v7:25.4.0.

Failed to resolve com.android.support:support-compat:25.4.0
Failed to resolve com.android.support:support-core-ui:25.4.0

I am trying to include this library to my project by adding

compile 'jp.wasabeef:recyclerview-animators:2.2.7'

so remove this line from gradle
my error just resolved

참고URL : https://stackoverflow.com/questions/44691858/failed-to-resolve-com-android-support-design25-4-0

반응형