Android 发布崩溃并出现异常 net.sqlcipher.database.SQLiteException

Saa*_*man 7 android proguard crash-reports sqlcipher-android release-apk

我已将我的应用程序上传到 Play 商店,但它仍然崩溃,如开发人员控制台的“崩溃报告图像”所示。

在某些设备上,该应用程序根本不运行

而在其他情况下,它在启动 sql 查询时崩溃

顺便说一句,混淆器被禁用

崩溃报告图像 崩溃报告图像

查询方法 询问

Saa*_*man -1

主要有两种崩溃异常

1. SQLite异常

我通过注释Build.gradle中的 proguardfiles 解决了这个问题,如下所示

 buildTypes {
        release {
            minifyEnabled false
            //proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
Run Code Online (Sandbox Code Playgroud)

2. 非法参数异常

如果您让您的应用程序在 android 12 中运行并且应用程序具有通知功能,则会有一个新的 PendingIntent 可变性标志

PendingIntent pendingIntent;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        pendingIntent = PendingIntent.getActivity(this,0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);

        //pendingIntent = PendingIntent.getActivity(this,0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);
}
else{
        pendingIntent = PendingIntent.getActivity(this,0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
}
Run Code Online (Sandbox Code Playgroud)