简体   繁体   中英

Firebase analytics crash while running android app

After using the vendor's dependencies, Firebase analytics gives the following error while opening the app. I tried to use latest dependencies but it seems like it didn't work.

Logcat

Dependencies tree found firebase-analytic 17.0.0 from tag manager which usually uses 19.0.1. Is this related to the crash?

Dependencies tree 1

Dependencies tree 2

build.gradle (project)

buildscript {
ext.kotlin_version = "1.4.32"
repositories {

    google()

    maven { url 'https://developer.huawei.com/repo/' }

    mavenCentral()
    maven { url "https://plugins.gradle.org/m2/" }

        url "https://maven.guardsquare.com"

        content {
            includeGroupByRegex "com\\.guardsquare.*"
        }
        authentication {
            basic(BasicAuthentication)
        }
    }
}
dependencies {
    // Google
    classpath 'com.google.gms:google-services:4.3.10'
    // Huawei
    classpath 'com.huawei.agconnect:agcp:1.6.0.300'

    classpath 'com.android.tools.build:gradle:7.0.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
    classpath 'com.google.firebase:perf-plugin:1.4.0'
    classpath "io.realm:realm-gradle-plugin:4.3.3"
    classpath "com.github.ben-manes:gradle-versions-plugin:0.39.0"
    classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1'
    classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
    classpath "org.jacoco:org.jacoco.core:0.8.7"
    classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3"
    classpath "com.guardsquare:proguard-gradle:7.1.1"
    classpath 'com.guardsquare:dexguard-gradle-plugin:1.1.12'
    classpath "com.newrelic.agent.android:agent-gradle-plugin:6.2.0"


}

build.gradle (project)

android {

compileSdkVersion 30
buildToolsVersion "30.0.3"

useLibrary 'org.apache.http.legacy'

defaultConfig {
    applicationId "com.tdcm.trueidapp"
    minSdkVersion 21
    targetSdkVersion 30

    versionName "${versionNameApp}"
    versionCode versionBuildNumber
    renderscriptTargetApi 21
    renderscriptSupportModeEnabled true

    multiDexEnabled true

    ndk {
        abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'arm64-v8a'
    }

}


dexOptions {
    preDexLibraries true
    javaMaxHeapSize "4g"
}

bundle {
    density.enableSplit = true
    abi.enableSplit = true
    language.enableSplit = true
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}

testOptions {
    unitTests.returnDefaultValues = true
}

buildFeatures {
    dataBinding true
}

aaptOptions {
    ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    noCompress 'db'
}
}

newrelic {
    excludeVariantInstrumentation("debug")
}

dependencies {
    implementation project(":features:splashscreen")
    implementation project(":common:share:datalegacy")

    implementation(name: 'appbase', ext: 'aar')

    Glide()
    UnitTesting()
}

PS. Sorry about image, I can't upload it yet.

SOLVED

Just add 2 lines of following

implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'

and

implementation "io.grpc:grpc-okhttp:1.32.2"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM