Android release crash with exception net.sqlcipher.database.SQLiteException

269 Views Asked by At

I've uploaded my app to play store but it still crashes as "crash report image" of developer console shows.

on some devices the app did not lunch at all

while on other it crashes when start sql query

btw proguard is disabled

crash report image crash report image

the query method query

1

There are 1 best solutions below

0
On

There are two main crash exceptions

1. SQLiteException

and I've solved this by comment the proguardfiles in Build.gradle as follow

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

2. illegalargumentexception

If you let your app to run in android 12 and app has notification feature, there is a new PendingIntent mutability flag

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);
}