programing tip

해결 실패 : com.android.support:cardview-v7:26.0.0 android

itbloger 2020. 8. 26. 07:38
반응형

해결 실패 : com.android.support:cardview-v7:26.0.0 android


내 프로젝트에 recyclerview를 추가하려고 시도 하고이 오류가 나타나고 android studio 종속성에서 추가했습니다. 이것은 안드로이드 스튜디오에서 recyclerview를 추가하려고 할 때 오류가 나타납니다.

이것은 컴파일 된 버전입니다 ...


지원 라이브러리 버전 26부터 repositories섹션에 " https://maven.google.com "엔드 포인트가 있는 maven 섹션이 포함되어 있는지 확인하십시오 .

같은 것;

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

이것이 내가 작동하는 방법입니다.

  1. maven { url "https://maven.google.com" }@Gabriele_Mariotti가 위에서 제안한대로 추가하십시오 .

    allprojects {
        repositories {
            jcenter()
            maven {
                url "https://maven.google.com"
            }
        }
    }
    
  2. 그런 다음 App 폴더 내부의 build.gradle 파일에서

    compileSdkVersion 26
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.xxx.yyy"
        minSdkVersion 16
        targetSdkVersion 26
    }
    
  3. 그런 다음 종속성 사용

    dependencies {
        compile 'com.android.support:appcompat-v7:26.0.1'
        compile 'com.android.support:design:26.0.1'
        compile 'com.google.android.gms:play-services-maps:11.0.4'
        compile 'com.google.android.gms:play-services-location:11.0.4'
        compile 'com.mcxiaoke.volley:library-aar:1.0.0'
        compile 'com.android.support:cardview-v7:26.0.1'
    }
    

Android Studio 3.0 이상을 사용하는 경우 프로젝트 build.gradle에 다음 과 유사한 콘텐츠가 있어야합니다.

buildscript {                 
    repositories {
        google()  // add google() before jcenter()
        jcenter()
    }
    dependencies {            
        classpath 'com.android.tools.build:gradle:3.0.1'

    }
}

allprojects {
    repositories {
        google()  // add google() before jcenter()
        jcenter()
    }
}

그리고위한 안드로이드 스튜디오 3.0 이하 및부터 지원 라이브러리 26 + 프로젝트 build.gradle는 this-과 같이해야한다

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

참고- 위치는 jcenter () 앞에 google ()을 추가하는 것이 정말 중요합니다.

자세한 내용은 아래 링크를 확인하십시오.

1- Android 앱 빌드

2- 빌드 종속성 추가

3- 빌드 구성


allprojects () 아래의 모든 프로젝트 레벨 build.gradle 파일에 이것을 추가하십시오.

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

SDK 및 Android 스튜디오 버전 (3.0 베타)을 업데이트하는 동안 동일한 문제가 발생합니다. 이 튜토리얼을 통해이 문제를 해결했습니다 . 이것에서 그들은 우리에게 다음과 같은 빌드 구성 파일을 업데이트하라고 말했습니다.

android {
   compileSdkVersion 26
   buildToolsVersion '26.0.0'
   defaultConfig {
   targetSdkVersion 26
  }
  ...
}

dependencies {
   compile 'com.android.support:appcompat-v7:26.0.0'
}

// REQUIRED: Google's new Maven repo is required for the latest
// support library that is compatible with Android 8.0
repositories {
   maven {
       url 'https://maven.google.com'
       // Alternative URL is 'https://dl.google.com/dl/android/maven2/'
   }
}

도움이되기를 바랍니다.


OneSignal이 종속성을 변경 한 경우

그래서 나는 그것을

compile 'com.onesignal:OneSignal:[3.5.8, 3.99.99]'

compile 'com.onesignal:OneSignal:[3.5.8, 3.5.8]'

그런 다음 작동합니다. 불특정 종속성을 확인하십시오.


이것을 프로젝트 레벨 build.gradle 파일에 추가하면 제대로 작동합니다.

allprojects {
    repositories {
        google() // this is to be added if there's something already.
        jcenter()
    }
}

Android 8.0과 호환되는 최신 지원 라이브러리에는 Google의 새로운 Maven 저장소가 필요합니다. 아래와 같이 Google의 Maven 저장소를 업데이트하십시오.

빌드에 추가 maven.google.com하려면 모듈 수준 build.gradle파일 의 Maven 저장소에 추가 하세요 .

repositories {
    maven {
        url 'https://maven.google.com'
        // Alternative URL is 'https://dl.google.com/dl/android/maven2/'
    }
}

또는 다음 build.gradle과 같이 파일 을 업데이트 할 수 있습니다 .

    repositories {
        jcenter()
        google()
    }

그런 다음 원하는 라이브러리를 종속성 블록에 추가하십시오. 예를 들어, cardview 라이브러리는 다음과 같습니다.

dependencies {
    compile 'com.android.support:cardview-v7:26.1.0'
}

sdk 28에서 사용할 수 있습니다.

implementation 'com.android.support:design:28.0.0'

및 cardView 라이브러리 제거


SDK 관리자에서 Android 지원 저장소를 업데이트하십시오.


Google 저장소를 추가하는 또 다른 방법이 있습니다.

  1. gradle-4.1-rc-1-allgradle-wrapper.properties에 추가하십시오 .

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip
    
  2. 그런 다음 google()최상위 build.gradle을 추가하십시오 .

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

'com.android.support:appcompat-v7:26.0.0'컴파일에서 빌드 버전을 변경하기 만하면됩니다.

'com.android.support:appcompat-v7:26.0.0-alpha1'컴파일

이것은 당신의 문제를 해결할 것입니다.


여기에있는 다른 솔루션이 작동하지 않으면 '오프라인'모드아닌지 확인하십시오 . 활성화되면 안드로이드는 필요한 파일을 다운로드하지 않고이 오류가 발생합니다.

여기에 이미지 설명 입력


컴파일을 시도하다

 compile 'com.android.support:cardview-v7:25.3.1'

터미널에서 gradle 청소

./gradlew clean

그런 다음 build.gradle 섹션에서이 코드를 사용하십시오.

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

포함 된 라이브러리 버전을 사용할 수 있는지 확인하십시오. 확인을 위해이 링크를 사용할 수 있습니다.


사용 compile 'com.android.support:cardview-v7:25.4.0'
버전 26을 원하면 compile 'com.android.support:cardview-v7:26.0.0-beta2'현재 베타 버전이므로을 사용해야합니다 .


android {
     compileSdkVersion 26
     buildToolsVersion '26.0.2'
     useLibrary 'org.apache.http.legacy'
 defaultConfig {
    applicationId "com.test"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}

이것은 나를 위해 일하고 있습니다


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

This should pull the most recent version, and allow it to compile.


try this,

goto Android->sdk make sure you have all depenencies required . if not , download them . then goto File-->Settigs-->Build,Execution,Depoyment-->Gradle

choose use default gradle wapper (recommended)

and untick Offline work

gradle build finishes successfully for once you can change the settings


May be this problem is due to facebook library. Replace

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

by

compile 'com.facebook.android:facebook-android-sdk:4.26.0'

@Aryan is correct Failed to resolve: com.android.support:appcompat-v7:27.+ (Dependency Error)

A picture worth thousand words

여기에 이미지 설명 입력


2 Steps to fix this.. 1, connect to internet. 2, Click on clean project. this will fix it :)


For me I just had to clean my project.

Build -> Clean Project

Another time I had to:

파일-> 프로젝트를 Gradle 파일과 동기화합니다.


Kotlin을 사용하여 Android Studio에서 새 프로젝트를 만들 때이 문제가 발생했습니다. 마침내 나를 도왔던 방식 :

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

참고 URL : https://stackoverflow.com/questions/45103230/failed-to-resolve-com-android-supportcardview-v726-0-0-android

반응형