【问题标题】:After Downloading app from google play store getting crashed?从谷歌Play商店下载应用程序后崩溃?
【发布时间】:2019-12-15 17:56:30
【问题描述】:

当我从 android studio 构建应用程序时,它运行良好。但是当我从Play商店下载时,该应用程序崩溃了。 请在附件中找到错误所在的 crashlytics 报告。

下面是我的build.gradle文件

apply plugin: 'com.android.application'


buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "igpl.gfee.com.gfee"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 4
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true

    }
    buildTypes {
        release {
            minifyEnabled false
            multiDexEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:support-vector-drawable:28.0.0'
    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.aurelhubert:ahbottomnavigation:2.1.0'
    implementation 'com.github.scottyab:showhidepasswordedittext:0.8'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'androidx.multidex:multidex:2.0.0'
    implementation 'com.google.firebase:firebase-core:10.0.1'
    implementation 'de.hdodenhof:circleimageview:1.2.1'
    //implementation 'com.journeyapps:zxing-android-embedded:3.4.0'
    implementation 'com.github.lzyzsd:circleprogress:1.2.1'
    implementation 'com.budiyev.android:code-scanner:1.2.1'
    implementation 'com.google.code.gson:gson:2.8.0'
    //noinspection GradleCompatible
    implementation 'com.google.firebase:firebase-messaging:15.0.0'
    implementation 'com.yalantis:ucrop:2.2.0'
    implementation 'com.github.chrisbanes:PhotoView:1.3.0'

    // implementation 'com.facebook.shimmer:shimmer:0.1.0@aar'
    //gson
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.2@aar') {
        transitive = true;
    }

    //Retrofit and RxJava Integration
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
    implementation 'com.squareup.picasso:picasso:2.4.0'
    //gson and retrofit integration
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.okhttp:okhttp:2.4.0'
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
    implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'


    //ButterKnife
    implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'com.github.silvestrpredko:dot-progress-bar:1.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'

下面是我的androidmanifest文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="igpl.gfee.com.gfee">

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="16" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <!--<uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />-->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.USE_FINGERPRINT" />
    <uses-permission android:name="android.permission.USE_BIOMETRIC" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/gfee_logo_new"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/gfee_logo_new"
        android:supportsRtl="true"
        android:testOnly="false"
        android:theme="@style/AppTheme"
        tools:replace="android:icon,android:theme">

        <activity
            android:name=".SplashScreen"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".LoginActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".MainActivity"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".Fragments.WorkSpace"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".Fragments.MainSurvey"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".Fragments.MainActivites.CreateOrganization"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".Fragments.MainActivites.AddressFragment"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".Fragments.MainActivites.CreateGroup"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".Fragments.Profile"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".QRScanner"
            android:screenOrientation="portrait" />
        <activity
            android:name=".GoalDashBoard"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".ProjectDashBoard"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".MileStoneDashBoard"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".TaskDetailsDashBoard"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".MeetingDashBoard"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".FingerprintActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name=".Fragments.EditProfile"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan" />
        <activity
            android:name=".WebRemote"
            android:screenOrientation="portrait" />
        <activity
            android:name=".VersionNumber"
            android:screenOrientation="portrait" />
        <activity
            android:name=".ChangePassword"
            android:screenOrientation="portrait" />

        <activity android:name=".Fragments.MainActivites.OrganizationsListData"
            android:screenOrientation="portrait"/>

        <activity android:name=".Fragments.MainActivites.OrganizationDashBoard"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan"/>

        <activity android:name=".Fragments.MainActivites.GroupDashBoard"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan"/>

        <activity android:name=".Fragments.MainActivites.GroupsListData"
            android:screenOrientation="portrait"/>

        <activity
            android:name=".SurveyActivities.CreateSurvey"
            android:screenOrientation="portrait" />

        <activity android:name=".Fragments.Survey.SurveyinfoScreens"
            android:screenOrientation="portrait"/>

        <activity android:name=".Fragments.Survey.Survey_PaidInfoScreens"
            android:screenOrientation="portrait"/>

        <activity
            android:name=".Utils.TempActivity"
            android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait" />
        <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait" />

        <meta-data
            android:name="io.fabric.ApiKey"
            android:value="262e4ef469d58d4188b4f4c8169fd4e4fe1417a3" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/splash_logo" />
        <!--
            <activity
            android:name=".Fragments.Main2Activity"
            android:label="@string/title_activity_main2"></activity>
        -->

        <receiver android:name=".BoardcastReceiver.IncomingSms">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".FCM.FirebaseDataReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </receiver>
        <receiver
            android:name=".FCM.MyBroadcastReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND">
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </receiver>

        <service android:name=".FCM.MyFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <service
            android:name=".FCM.MyFirebaseInstanceIDService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>

        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
            android:permission="android.permission.INSTALL_PACKAGES"
            android:enabled="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER"/>
            </intent-filter>
        </receiver>

        <activity
            android:name=".Fragments.MainActivites.OrganizationDetails"
            android:screenOrientation="portrait"
            android:label="@string/title_activity_scrolling"
            android:theme="@style/AppTheme"></activity>

        <activity android:name=".Fragments.MainActivites.OrganizationSummary"
            android:screenOrientation="portrait"/>
        <activity android:name=".Fragments.MainActivites.ImageZoomActivity"
            android:screenOrientation="portrait"/>
    </application>

</manifest>

【问题讨论】:

  • 可能是因为proguard 混淆了该类
  • 您实施过推荐服务吗?
  • 您使用 InstallReferrerReceiver 的步骤是什么?
  • 我没有使用任何推荐服务。
  • @ManojPerumarath 你想让我删除 proguard 吗?

标签: android google-play google-fabric crashlytics-android


【解决方案1】:

AppMeasurementInstallReferrerReceiver 类是firebase-core 库的一部分。

错误说在dex路径中找不到AppMeasurementInstallReferrerReceiver类。这意味着您使用的版本不包含指定的类。

从清单中,我们可以看到您使用的是firebase-core 版本的10.0.1。将firebase-core 更新为17.0.1,将firebase-messaging 更新为19.0.1

从 ADB 测试它或在 Play 商店中发布它以测试它。

【讨论】:

  • 当我更改我的 firebase-core 和 firebase-messaging 的版本时,我遇到了错误 tools:replace specified at line:19 for attribute android:appComponentFactory, but no new value specified app main manifest Manifest merger failed with multiple errors, see logs at com.android.builder.core.AndroidBuilder.mergeManifestsForApplication
  • 你能试试 (firebase-core) 和 16.0.8 和 (firebase-messaging) 18.0.0
  • 是的,它没有任何错误。但是让我在 Play 商店中发布应用程序后尝试解决我的主要错误。
  • 感谢@Srikar Reddy 将 firebase 更改为 16.0.8 并将 firebase-messaging 更改为 18.0.0 对我有用
【解决方案2】:

禁用 R8 代码压缩器并在 Playstore 上更新

go to->gradle.properties
add -> android.enableR8 = false

【讨论】:

    【解决方案3】:

    如果您不使用此接收器,请从清单中删除此接收器。

        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
            android:permission="android.permission.INSTALL_PACKAGES"
            android:enabled="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER"/>
            </intent-filter>
        </receiver>
    

    【讨论】:

    • 我没有使用它。由于我面临的错误,我刚刚添加了它,但它没有帮助我。好的,我会删除
    • 所以你要我删除它并检查
    • @SunilP 是的,删除此接收器并将 APK 上传到 Play 商店。这肯定会奏效。
    • 好的,我已将其删除。但它仍然像以前一样,我想我会再次面临同样的错误吗?
    • 如果你想在不上传到play store的情况下查看,你可以尝试使用ADB发送广播。
    【解决方案4】:

    也许是因为minifyEnabled false。 您可以将发布模式规则应用到调试模式并检查。

    buildTypes {
            release {
                minifyEnabled false
                multiDexEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        debug {
                minifyEnabled false
                multiDexEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    

    【讨论】:

    • 让我试试@bhavesh
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多