从Google Play商店下载应用后,出现崩溃问题?

6

当我从 Android Studio 构建我的应用时,它可以正常工作。但是,当我从 Play Store 下载应用时,它会崩溃。

请查看附加的 Crashlytics 报告,里面指出了错误。enter image description here

以下是我的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混淆了那个类。 - Manoj Perumarath
你实现了任何推荐服务吗? - Rahul Khurana
@ManojPerumarath 你想让我移除 Proguard 吗? - Sunil P
@SunilP 我已经添加了一个关于这个问题的答案。 - Rishabh Sagar
不建议移除Proguard,只应该从上述提到的类中移除。 - Manoj Perumarath
显示剩余8条评论
4个回答

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指定在第19行属性android:appComponentFactory,但没有指定新值应用程序主清单清单合并失败,出现多个错误,请参见日志com.android.builder.core.AndroidBuilder.mergeManifestsForApplication - Sunil P
你能否尝试使用 firebase-core 版本 16.0.8firebase-messaging 版本 18.0.0 - Srikar Reddy
是的,它没有出现任何错误。但在将应用程序发布到Play商店后,让我试一试我的主要漏洞。 - Sunil P
1
感谢@Srikar Reddy,将Firebase更改为16.0.8和Firebase Messaging更改为18.0.0后,它对我起作用了。 - Sunil P

0
禁用 R8 代码收缩器并在 Play 商店上更新。
go to->gradle.properties
add -> android.enableR8 = false

0

如果你不使用该接收器,请从清单中移除它。

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

我没有使用它。我只是添加了它,因为我遇到了错误,但它并没有帮助我。好的,我会将其删除。 - Sunil P
所以你想让我移除那个并检查。 - Sunil P
@SunilP 是的,移除这个接收器并将 APK 上传到 Play 商店。这肯定会起作用。 - Rishabh Sagar
好的,我已经将它删除了。但是它仍然保留着之前的状态,我认为我会再次遇到同样的错误吗? - Sunil P
如果您想在不上传到Play商店的情况下进行检查,可以尝试使用ADB发送广播。 - Rishabh Sagar
让我们在聊天中继续这个讨论 - Sunil P

0
也许是因为 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 - Sunil P

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接