从Playstore首次下载后,应用程序崩溃了吗?

时间:2018-06-22 11:23:16

标签: android gmsmapview

当我在每台设备上的Playstore上上传新应用程序后,第一次下载该应用程序时崩溃,第二次以后它运行正常。

请在下面找到崩溃报告并进行构建。摇动。

我的所有依赖项都列在gradel文件中。

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzac;
    at com.google.android.gms.measurement.internal.zzu.<init>(Unknown Source)
    at com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver.zzbso(Unknown Source)
    at com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver.onReceive(Unknown Source)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:2758)
    at android.app.ActivityThread.access$1900(ActivityThread.java:153)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1452)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:5523)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzac" on path: DexPathList[[zip file "/data/app/com.location.memory-1/base.apk"],nativeLibraryDirectories=[/data/app/com.location.memory-1/lib/arm64, /data/app/com.location.memory-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 12 more
    Suppressed: java.lang.ClassNotFoundException: com.google.android.gms.common.internal.zzac
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 13 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
  

build.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'io.fabric'

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        maven { url "https://jitpack.io" }
        jcenter()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.1'
        classpath 'com.malmstein:fenster:0.0.2'
        classpath 'me.tatarka:gradle-retrolambda:3.7.0'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
    }
}


// Required because retrolambda is on maven central
repositories {
    mavenCentral()
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://jitpack.io" }
    maven { url 'https://maven.google.com' }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "com.location.memory"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 4
        versionName "1.0.1"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                cppFlags "-frtti -fexceptions"
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }

    configurations.all {
        resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lintOptions {
        abortOnError false
    }
    packagingOptions {
        exclude 'META-INF/rxjava.properties'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v13:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:design:27.1.1'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.google.code.gson:gson:2.8.4'

    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-places:15.0.1'

    // Admob sdk
    implementation 'com.google.android.gms:play-services-ads:15.0.1'

    // dagger
    implementation 'com.google.dagger:dagger:2.16'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.16'
    compileOnly 'javax.annotation:jsr250-api:1.0'
    // event bus
    implementation 'org.greenrobot:eventbus:3.1.1'
    // boilerplate generation
    implementation 'org.glassfish:javax.annotation:10.0-b28'
    compileOnly 'org.projectlombok:lombok:1.16.20'
    annotationProcessor 'org.projectlombok:lombok:1.16.20'

    // dependency injection
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

    implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'

    // draw route map
    implementation 'com.github.ar-android:DrawRouteMaps:1.0.0'

    // fabric crashlytis library
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
        transitive = true;
    }

    // image loading
    implementation 'com.github.bumptech.glide:glide:4.4.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'

    // joda date time library
    implementation 'net.danlew:android.joda:2.9.9.1'

    // capture image + gallery
    implementation 'com.github.jkwiecien:EasyImage:1.3.1'

    // rxpermission for android device
    implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar'
    implementation 'com.karumi:dexter:4.2.0'

    // ACProgressLite progress dialog
    implementation 'cc.cloudist.acplibrary:library:1.2.1'

    // Stetho core
    implementation 'com.facebook.stetho:stetho:1.5.0'

    //Optional network helper
    implementation 'com.facebook.stetho:stetho-okhttp:1.5.0'

    implementation 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
    implementation 'com.github.jd-alexander:library:1.1.0'

    // calculate distance
    implementation 'com.google.maps.android:android-maps-utils:0.5'
    // floating action menu
    implementation 'com.github.kobakei:MaterialFabSpeedDial:1.2.0'

   // implementation 'pl.charmas.android:android-reactive-location2:2.1'
    implementation 'com.google.android.gms:play-services-location:15.0.1' //you can use newer GMS version if you need
    implementation 'io.reactivex.rxjava2:rxjava:2.1.14'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
   // implementation 'com.github.safetysystemtechnology:location-tracker-background:v1.3'
    //implementation 'com.github.kayvannj:PermissionUtils:1.0.9'
    implementation 'com.agilie:swipe2delete:1.0'

    implementation 'com.google.apis:google-api-services-jobs:v2-rev7-1.23.0'

 }


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

2 个答案:

答案 0 :(得分:0)

很可能是由于proguard规则所致。

您添加了

  

-dontwarn com.google.errorprone.annotations。*

在您的前卫文件中

https://github.com/google/dagger/blob/master/java/dagger/android/proguard.cfg

答案 1 :(得分:0)

为避免在从Play商店安装应用后首次启动时发生崩溃,此版本要求发行商在其build.gradle中声明其他依赖项:

implementation 'com.google.android.gms:play-services-measurement-impl:17.0.0'
implementation 'com.google.android.gms:play-services-ads:18.0.0'