简体   繁体   English

无法解析:com.google.firebase:firebase-analytics:19.0.0

[英]Failed to resolve: com.google.firebase:firebase-analytics:19.0.0

I am trying to add Firebase Analytics and I am constantly getting the follow errors when trying to sync the Gradle project:我正在尝试添加 Firebase Analytics,并且在尝试同步 Gradle 项目时不断收到以下错误:

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

This is the implementation that I am using:这是我正在使用的实现:

implementation 'com.google.firebase:firebase-analytics:17.2.1'

and

classpath 'com.google.gms:google-services:4.3.3'

I have read various posts but non seem to resolve this issue.我已经阅读了各种帖子,但似乎没有解决这个问题。

For some reason, I am seeing that is trying to resolve for version 19.0.0 when I am explicitly telling it to use version 17.2.1 .出于某种原因,当我明确告诉它使用版本17.2.1时,我看到它正在尝试解决版本19.0.0

This is a snippet of the build.gradle:这是 build.gradle 的一个片段:

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'
}

And project build.gradle:和项目 build.gradle:

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"
            }
        }
    }
}

Any ideas of what could be causing this conflict?关于什么可能导致这种冲突的任何想法?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法解析 com.google.firebase:firebase-analytics:16.5.0 - Could not resolve com.google.firebase:firebase-analytics:16.5.0 对Firebase Analytics使用“com.google.firebase:firebase-analytics”? - Use 'com.google.firebase:firebase-analytics' for Firebase Analytics? “找不到 com.google.firebase:firebase 分析” - "Could not find com.google.firebase:firebase-analytics" 找不到 com.google.firebase:firebase-analytics: - Could not find com.google.firebase:firebase-analytics: 清单合并失败依赖于 com.google.firebase:firebase-analytics:17.2.2 - Manifest merger failed on dependency com.google.firebase:firebase-analytics:17.2.2 其他各种库都在请求库com.google.firebase:firebase-analytics - The library com.google.firebase:firebase-analytics is being requested by various other libraries 包括“implementation 'com.google.firebase:firebase-analytics:17.4.4'”会导致应用程序在每次启动时崩溃 - Including "implementation 'com.google.firebase:firebase-analytics:17.4.4'" causes app to crash at startup every time 无法解决:com.google.firebase:firebase-core:17.0.0 - Failed to resolve: com.google.firebase:firebase-core:17.0.0 无法解决:com.google.firebase:firebase-core:16.0.5 - Failed to resolve: com.google.firebase:firebase-core:16.0.5 错误:无法解决:com.google.firebase:firebase-appindexing - ERROR: Failed to resolve: com.google.firebase:firebase-appindexing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM