Coonte
Coonte

Reputation: 25

Error:(30, 18) Failed to resolve: com.android.support:design-v7:25.3.1

I have already add the "maven{url "https://maven.google.com"}" but it doesn't work This is my build.gradle file:

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.3'
            classpath 'com.google.gms:google-services:3.2.0'
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }

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

    task clean(type: Delete) {
        delete rootProject.buildDir
    }

And this is my other build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {
        applicationId "com.quizapp.conte.quizapp"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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'
    })
    compile 'com.google.firebase:firebase-core:10.2.0'
    compile 'com.google.firebase:firebase-database:10.2.0'
    compile 'com.rengwuxian.materialedittext:library:2.1.4'
    compile 'com.android.support:cardview-v7:25.3.1'
    debugCompile 'com.android.support:design-v7:25.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
    testCompile 'junit:junit:4.12'
    compile 'com.google.firebase:firebase-core:11.8.0'
}

apply plugin: 'com.google.gms.google-services'    

Any ideas on what I'm doing wrong? I tried everything and I do not know what to do. I started the project recently so i didn't modify other files exept the build.gradle. Thank you all.

Upvotes: 2

Views: 569

Answers (2)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 364654

Error:(30, 18) Failed to resolve: com.android.support:design-v7:25.3.1

It happens because this dependency doesn't exist.

Use

debugCompile 'com.android.support:design:25.3.1'

instead of

debugCompile 'com.android.support:design-v7:25.3.1'

Upvotes: 0

Ali Akbarpour
Ali Akbarpour

Reputation: 964

In new Gradle version(4.1+), you must use google repository like below

allprojects {
    repositories {
        google()

       }
}

If you're using a version of Gradle lower than 4.1, you must instead use

allprojects {
        repositories {
         maven {
            url 'https://maven.google.com'
        // An alternative URL is 'https://dl.google.com/dl/android/maven2/'

           }
    }

Upvotes: 0

Related Questions