Closed matheuslns closed 1 month ago
I discovered the problem: the qr_mobile_vision package and flutter_local_notifications use the same code to request permissions, which is why it causes an error when used together.
The solution is to modify the REQUEST_PERMISSION field to a unique code.
Package: qr_mobile_vision File: QrMobileVisionPlugin.java
private static final int REQUEST_PERMISSION = 1;
Package: flutter_local_notifications File: FlutterLocalNotificationsPlugin.java
static final int NOTIFICATION_PERMISSION_REQUEST_CODE = 1;
Description: I am encountering a crash in my Flutter app immediately after launching the app on specific Android devices when using the
qr_mobile_vision
package. The app crashes as soon as it opens, and the error occurs when trying to handle permission requests. Below is the full stack trace of the error:Stack Trace:
Steps to Reproduce:
qr_mobile_vision
package in a Flutter app.Expected Behavior: The app should open and handle permission requests without crashing, allowing the camera functionality to work properly.
Environment:
Additional Context: The crash seems to be caused by a
NullPointerException
when handling the permission result. I have verified that the required camera permissions are declared in theAndroidManifest.xml
, and the crash happens as soon as the app launches.Please let me know if you need further details to assist in resolving this issue.