首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >解决失败: com.google.firebase:firebase-analytics:19.0.0

解决失败: com.google.firebase:firebase-analytics:19.0.0
EN

Stack Overflow用户
提问于 2020-01-06 20:33:23
回答 1查看 1.6K关注 0票数 0

我正在尝试添加Firebase,在尝试同步Gradle项目时,我经常会得到以下错误:

代码语言:javascript
复制
ERROR: Failed to resolve: com.google.firebase:firebase-analytics:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-analytics:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-location:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-base:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-cast-framework:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-basement:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-tasks:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.firebase:firebase-measurement-connector:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.android.gms:play-services-stats:19.0.0
Show in Project Structure dialog
Affected Modules: app


ERROR: Failed to resolve: com.google.firebase:firebase-iid-interop:19.0.0
Show in Project Structure dialog
Affected Modules: app

这是我正在使用的实现:

代码语言:javascript
复制
implementation 'com.google.firebase:firebase-analytics:17.2.1'

代码语言:javascript
复制
classpath 'com.google.gms:google-services:4.3.3'

我读过各种帖子,但似乎没有解决这个问题。

出于某种原因,当我明确告诉19.0.0使用版本17.2.1时,我看到它正试图解决这个问题。

这是build.gradle的一个片段:

代码语言:javascript
复制
plugins {
    id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 28
    buildToolsVersion '28.0.3'
    useLibrary  'org.apache.http.legacy'
    flavorDimensions "default"


    lintOptions {
        checkReleaseBuilds false
    }

}

repositories {
    google()
    jcenter()
}

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.onesignal:OneSignal:3.11.4'

    implementation 'pl.droidsonroids:casty:1.0.8'
    implementation 'androidx.mediarouter:mediarouter:1.1.0'

    implementation 'com.google.firebase:firebase-analytics:17.2.1'
    implementation 'com.devbrackets.android:exomedia:4.3.0'
}

以及项目build.gradle:

代码语言:javascript
复制
buildscript {
    repositories {
        google()
        jcenter()


    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        classpath 'com.google.gms:google-services:4.3.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }

    configurations.all {
        resolutionStrategy.force "com.google.android.gms:play-services-cast:12.0.1"
    }
}

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->

            if (details.requested.group == 'com.google.android.gms'
                    && details.requested.name.contains('play-services-cast')) {
                details.useVersion "12.0.1"
            }
        }
    }
}

对什么会导致这场冲突有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2020-04-06 13:16:16

试试这个实现'com.google.firebase:firebase-analytics:17.2.2‘

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59618591

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档