In short, when I implement the latest version of firebase-core (version 16.0.7) in my APP-LEVEL build.gradle file, and when I sync with Gradle files, it fails to download one of the dependencies for firebase-core, called firebase-measurement-connector-impl. It searches for version 17.0.5, and it fails to download it.

I took a look at Google's Maven repository (maven.google.com) and in mvnrepository.com, and the version exists. But when I try to download the .jar file manually myself (using Chrome), it ALSO errors out! It says "Error - no file". Am I onto something, or am I missing something (like always)?

App-level build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
check.dependsOn 'assembleDebugAndroidTest'

android {
    compileSdkVersion 28
    flavorDimensions "minSdkVersion"

    defaultConfig {
        applicationId "me.testweb.firebaseoauthtest"
        buildToolsVersion("28.0.3")
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner 
        'android.support.test.runner.AndroidJUnitRunner'
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 
            'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
    buildToolsVersion '28.0.3'
}

configurations.all {
    resolutionStrategy.force 'com.android.support:support- 
    annotations:28.0.0'
}

dependencies {
    implementation project(':chooser')
    implementation project(':lintchecks')
    implementation 'com.android.support:multidex:1.0.3'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'

    // Firebase Authentication
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-auth:16.1.0'

    // Google Sign In SDK (only required for Google Sign In)
    implementation 'com.google.android.gms:play-services-auth:16.0.1'

    // Firebase UI
    // Used in FirebaseUIActivity.
    implementation 'com.firebaseui:firebase-ui-auth:4.3.1'

    // Twitter Android SDK (only required for Twitter Login)
    implementation 'com.twitter.sdk.android:twitter-core:3.3.0'
    implementation 'com.twitter.sdk.android:twitter:3.3.0'

    androidTestImplementation 'com.android.support.test.espresso:espresso- 
    core:3.0.2'
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.21"
}

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

Project-level build.gradle:

// Top-level build file where you can add configuration options common to 
all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21'
    }
}

allprojects {
    repositories {
        //mavenLocal() must be listed at the top to facilitate testing
        mavenLocal()
        google()
        jcenter()
        maven { url 'https://maven.fabric.io/public' }
    }
}

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

The expected result, is that the build process will download everything successfully (including firebase-measurement-connector-impl), and it won't show any errors.

The actual result, is that it will FAIL to download firebase-measurement-connector-impl, but everything still builds successfully (???).

Answer

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions