Install repository and sync project ошибка

I am trying to use the support libraries of version 25.2.0
so I will be able to use the CameraKit library.

I have got the newest build tools downloaded:

enter image description here

and the support repository:
enter image description here

my gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'
    defaultConfig {
        applicationId "com.sample.myapp"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    maven {
        url "https://jitpack.io"
    }
    mavenCentral()
}

dependencies {
    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'

    // Google libraries
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.android.support:support-v4:25.2.0'
    compile 'com.google.android.gms:play-services-vision:10.0.1'
    compile 'com.android.volley:volley:1.0.0'

    // Third party libraries
    compile 'com.flurgle:camerakit:0.9.17'

    compile 'com.android.support:recyclerview-v7:25.2.0'
    compile 'com.android.support:cardview-v7:25.2.0'
}

Problem:
For each support-library I get the issue:

Failed to resolve com.android.support:cardview-v7:25.2.0

If I try to click on Install repository and sync project nothing happens.

enter image description here

I have followed that gradle file as an example. Were could be my mistake?

If you are facing Google maven respository error like this,

ERROR: Failed to resolve: com.android.support:appcompat-v7:23.3.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.android.support:support-v4:23.3.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.android.support:design:23.3.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app

Try the following method,

In your project’s build.gradle file, add following lines into the repositories blocks like this:

repositories {
        maven {
            url 'https://maven.google.com'
        }
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }

There is 2 respositories, So make changes to both of them.

Now Try to Sync

Hit Thanks If it helped you, Which will help others to notice easily

Solution 1

Try using the latest support library versions:

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services-vision:10.2.1'
compile 'com.android.volley:volley:1.0.0'
// Third party libraries
compile 'com.flurgle:camerakit:0.9.17'

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

here is the detail Dependencies

EDIT

Use Google Maven Repository

To add them to your build, you need to first include Google’s Maven repository in your top-level build.gradle file:

Project — build.gradle (Not app build.gradle)

 allprojects {
    repositories {
        // If you're using a version of Gradle lower than 4.1, you must instead use:
        maven {
            url 'https://maven.google.com'
        }
        // An alternative URL is 'https://dl.google.com/dl/android/maven2/'

       jcenter()
    }
}

Solution 2

Previously the Android Support Library dependencies were downloaded from Android SDK Manager.

Now all the new versions are available from Google’s Maven repository.
In future all android libraries will be distributed through maven.google.com

So, by adding the below code to the repositories will build the project.

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

Solution 3

I had to add the following to my project level build.gradle. Then the button to install and worked.

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

Solution 4

Make sure to put it under allprojects! My mistake was to put it under buildscript.

DON’T DO THIS:

buildscript {
    repositories {
        jcenter()
         maven {
             url 'https://maven.google.com' //don't put it here
         }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

BUT INSTEAD DO THIS:

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com' //put it here
        }
    }
}

Comments

  • I am trying to use the support libraries of version 25.2.0
    so I will be able to use the CameraKit library.

    I have got the newest build tools downloaded:

    enter image description here

    and the support repository:
    enter image description here

    my gradle file:

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 25
        buildToolsVersion '25.0.2'
        defaultConfig {
            applicationId "com.sample.myapp"
            minSdkVersion 21
            targetSdkVersion 25
            versionCode 1
            versionName "1.1"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    repositories {
        maven {
            url "https://jitpack.io"
        }
        mavenCentral()
    }
    
    dependencies {
        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'
    
        // Google libraries
        compile 'com.android.support:appcompat-v7:25.2.0'
        compile 'com.android.support:design:25.2.0'
        compile 'com.android.support:support-v4:25.2.0'
        compile 'com.google.android.gms:play-services-vision:10.0.1'
        compile 'com.android.volley:volley:1.0.0'
    
        // Third party libraries
        compile 'com.flurgle:camerakit:0.9.17'
    
        compile 'com.android.support:recyclerview-v7:25.2.0'
        compile 'com.android.support:cardview-v7:25.2.0'
    }
    

    Problem:
    For each support-library I get the issue:

    Failed to resolve com.android.support:cardview-v7:25.2.0
    

    If I try to click on Install repository and sync project nothing happens.

    enter image description here

    I have followed that gradle file as an example. Were could be my mistake?

  • I have applied the changes you suggest and get the issue: Failed to resolve: com.android.support:design:25.3.1

  • the dependency is from official documentation…clean build and make sure you are connected to internet

  • @jublikon Since it is not listed in your Android studio, you need to pull the latest. You have not updated in a while.

  • I don’t understand why they wouldn’t include this in new projects.

  • puttingin the url for maven in the build.gradle sollve my problem on this… Thanks..

Recents

Related

I am trying to use the support libraries of version 25.2.0
so I will be able to use the CameraKit library.

I have got the newest build tools downloaded:

and the support repository:

my gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'
    defaultConfig {
        applicationId "com.sample.myapp"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    maven {
        url "https://jitpack.io"
    }
    mavenCentral()
}

dependencies {
    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'

    // Google libraries
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.android.support:support-v4:25.2.0'
    compile 'com.google.android.gms:play-services-vision:10.0.1'
    compile 'com.android.volley:volley:1.0.0'

    // Third party libraries
    compile 'com.flurgle:camerakit:0.9.17'

    compile 'com.android.support:recyclerview-v7:25.2.0'
    compile 'com.android.support:cardview-v7:25.2.0'
}

Problem:
For each support-library I get the issue:

Failed to resolve com.android.support:cardview-v7:25.2.0

If I try to click on Install repository and sync project nothing happens.

I have followed that gradle file as an example. Were could be my mistake?

With latest Android Studio, I change the targetSdkVersion and compileSdkVersion of my old exercise to 28. And I also have to use updated com.android.support:appcompat-v7 and com.android.support.constraint:constraint-layout. After fail in rebuild, it’s a number of WARNING and ERROR.

——————————
ERROR: Failed to resolve: com.android.support:appcompat-v7:28.0.0
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.android.support.constraint:constraint-layout:1.1.3
Add Google Maven repository and sync project
Show in Project Structure dialog
Affected Modules: app


WARNING: Configuration ‘compile’ is obsolete and has been replaced with ‘implementation’ and ‘api’.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app


WARNING: Configuration ‘testCompile’ is obsolete and has been replaced with ‘testImplementation’.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app


WARNING: Configuration ‘androidTestCompile’ is obsolete and has been replaced with ‘androidTestImplementation’.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app
——————————

As suggested, I change  ‘compile’, ‘testCompile’ and ‘androidTestCompile’ to ‘implementation’, ‘testImplementation’ and ‘androidTestImplementation’, in app/build.gradle.

To fix the error of Failed to resolve: com.android.support:appcompat-v7:28.0.0 and com.android.support.constraint:constraint-layout:1.1.3, I add the follow lines of Google Maven repository to build.gradle.

        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

And rebuild the project. At least it works for me now.


So, how to know the latest version of com.android.support:appcompat-v7 and com.android.support.constraint:constraint-layout?

For Support Library, you can check here: Android Developers > Platform > Libraries > Recent Support Library Revisions

28.0.0 is the recentest stable release of Support Library released on September 21, 2018 and will be the last feature release under the android.support packaging.

For ConstraintLayout, Google announced at https://androidstudio.googleblog.com/2018/08/constraintlayout-113.html.

You can also check from Maven repository:
>> com.android.support >> appcompat-v7
>> com.android.support.constraint >> constraint-layout

Понравилась статья? Поделить с друзьями:

Не пропустите эти материалы по теме:

  • Яндекс еда ошибка привязки карты
  • Install fabric any version ошибка
  • Install black cartridge hp ошибка
  • Instagram ошибка при создании аккаунта
  • Instagram ошибка подождите

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии