Mobile app crash on Android 13
-
Hi,
I raised the API of my mobile application written in Qt5.15 to 33. From now on, after uploading the application to the phone, the application turns on for 1 second and then turns off if it is Android 13. There is no such problem on Android 11. What may be the problem?I don't get much information in the console. How could I identify the problem?
-
@Creatorczyk said in Mobile app crash on Android 13:
How could I identify the problem?
Did you run through debugger?
-
@jsulm Hi, I found the cause of the error. It turns out that Android 13 withdrew the "WRITE_EXTERNAL_STORAGE" permissions.
https://medium.com/@muhammadbilal4074/storage-permission-in-android-13-89372e543864auto result = QtAndroid::checkPermission(QString("android.permission.WRITE_EXTERNAL_STORAGE")); if(result == QtAndroid::PermissionResult::Denied){ QtAndroid::PermissionResultMap resultHash = QtAndroid::requestPermissionsSync(QStringList({"android.permission.WRITE_EXTERNAL_STORAGE"})); if(resultHash["android.permission.WRITE_EXTERNAL_STORAGE"] == QtAndroid::PermissionResult::Denied){ return 0; } }
I removed these permissions, but I think I need them to read the SQLite database. Because the application closes when you try to perform an operation on it. I also tried replacing it with "READ_MEDIA_IMAGES" but it didn't help.
auto result = QtAndroid::checkPermission(QString("android.permission.READ_MEDIA_IMAGES")); if(result == QtAndroid::PermissionResult::Denied){ QtAndroid::PermissionResultMap resultHash = QtAndroid::requestPermissionsSync(QStringList({"android.permission.READ_MEDIA_IMAGES"})); if(resultHash["android.permission.READ_MEDIA_IMAGES"] == QtAndroid::PermissionResult::Denied){ return 0; }
How could I fix this error?
-
@Creatorczyk said in Mobile app crash on Android 13:
Because the application closes when you try to perform an operation on it
So, did you investigate why? Run through debugger to see what happens.
-
@Creatorczyk which version of 5.15 are you using ?