wfmn17
wfmn17

Reputation: 204

FirebaseUI auth Error:Failed to resolve: com.android.support:xxx:26.0.1

I'm trying to add FirebaseUI Auth to my project, but I keep getting sync fails like this:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not find com.android.support:appcompat-v7:26.0.1.
 Required by:
     project :app
> Could not find com.android.support:support-compat:26.0.1.
 Required by:
     project :app
> Could not find com.android.support.constraint:constraint-layout:1.1.0-beta1.
 Required by:
     project :app
> Could not find com.android.support:design:26.0.1.
 Required by:
     project :app > com.firebaseui:firebase-ui-auth:2.3.0
> Could not find com.android.support:customtabs:26.0.1.
 Required by:
     project :app > com.firebaseui:firebase-ui-auth:2.3.0
> Could not find com.android.support.constraint:constraint-layout:1.1.0-beta1.
 Required by:
     project :app > com.firebaseui:firebase-ui-auth:2.3.0
> Could not find com.android.support:cardview-v7:26.0.1.
 Required by:
     project :app > com.firebaseui:firebase-ui-auth:2.3.0
> Could not find com.android.support:appcompat-v7:26.0.1.
 Required by:
     project :app > com.google.android.gms:play-services:11.0.4 > com.google.android.gms:play-services-cast:11.0.4 > com.android.support:mediarouter-v7:25.2.0
> Could not find com.android.support:support-compat:26.0.1.
 Required by:
     project :app > com.google.android.gms:play-services:11.0.4 > 
com.google.android.gms:play-services-basement:11.0.4 > 
com.android.support:support-v4:25.2.0
     project :app > com.google.android.gms:play-services:11.0.4 > 
com.google.android.gms:play-services-cast:11.0.4 >     
com.android.support:mediarouter-v7:25.2.0 > com.android.support:palette-v7:25.2.0
     project :app > com.google.android.gms:play-services:11.0.4 > 
com.google.android.gms:play-services-basement:11.0.4 > 
com.android.support:support-v4:25.2.0 > com.android.support:support-media-
compat:25.2.0
     project :app > com.google.android.gms:play-services:11.0.4 > 
com.google.android.gms:play-services-basement:11.0.4 > 
com.android.support:support-v4:25.2.0 > com.android.support:support-core-utils:25.2.0
     project :app > com.google.android.gms:play-services:11.0.4 > 
com.google.android.gms:play-services-basement:11.0.4 > 
com.android.support:support-v4:25.2.0 > com.android.support:support-core-ui:25.2.0
     project :app > com.google.android.gms:play-services:11.0.4 > 
com.google.android.gms:play-services-basement:11.0.4 > 
com.android.support:support-v4:25.2.0 > com.android.support:support-fragment:25.2.0

My app level build.gradle looks like this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.chalker.chalker"
        minSdkVersion 23
        targetSdkVersion 26
        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(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:26.0.1'
    compile "com.android.support:support-compat:26.0.1"
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services:11.0.4'
    compile 'com.firebaseui:firebase-ui-auth:2.3.0'
}
apply plugin: 'com.google.gms.google-services'

And my project level build.gradle:

buildscript {
    repositories {
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

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

I read similar questions here and did the suggestions which solved the problem for others, but I just couldn't get mine to work... Thanks for every help in advance! Viktor

Upvotes: 1

Views: 997

Answers (1)

Bob Snyder
Bob Snyder

Reputation: 38289

In your project-level build.gradle, move this block:

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

from buildscript/repositories to allprojects/repositories.

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

Upvotes: 4

Related Questions