【问题标题】:firebase-measurement-connector-impl cannot be resolved when syncing with gradle files与 gradle 文件同步时无法解决 firebase-measurement-connector-impl
【发布时间】:2019-02-17 07:46:35
【问题描述】:

简而言之,当我在我的 APP-LEVEL build.gradle 文件中实现最新版本的 firebase-core(版本 16.0.7)时,当我与 Gradle 文件同步时,它无法下载 firebase 的依赖项之一-core,称为 firebase-measurement-connector-impl。搜索17.0.5版本,下载失败。

我查看了 Google 的 Maven 存储库 (maven.google.com) 和 mvnrepository.com,版本存在。但是当我尝试自己手动下载 .jar 文件(使用 Chrome)时,它也会出错!它说“错误 - 没有文件”。我是在做某事,还是我错过了什么(像往常一样)?

应用级 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'

项目级 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
}

预期的结果是,构建过程将成功下载所有内容(包括 firebase-measurement-connector-impl),并且不会显示任何错误。

实际结果是,下载firebase-measurement-connector-impl 会失败,但一切仍然构建成功(???)。

【问题讨论】:

    标签: android firebase dependencies


    【解决方案1】:

    从 实施 'com.google.firebase:firebase-core:16.0.7' 到 实施 'com.google.firebase:firebase-core:16.0.5'

    【讨论】:

      猜你喜欢
      • 2019-05-17
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      • 1970-01-01
      • 1970-01-01
      • 2016-10-09
      • 1970-01-01
      • 2019-08-29
      相关资源
      最近更新 更多