-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/plugins
#3127Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.p: cameraThe camera pluginThe camera pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
App crashes when users gives permission to access the gallery for the very first time with error message showing
07-20 12:41:37.841 4132-4132/com.----.--- E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.----.-----, PID: 4132
java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Surface android.media.ImageReader.getSurface()' on a null object reference
at io.flutter.plugins.camera.CameraPlugin$Camera.startPreview(CameraPlugin.java:676)
at io.flutter.plugins.camera.CameraPlugin$Camera.access$2000(CameraPlugin.java:243)
at io.flutter.plugins.camera.CameraPlugin$Camera$3.onOpened(CameraPlugin.java:443)
at android.hardware.camera2.impl.CameraDeviceImpl$1.run(CameraDeviceImpl.java:139)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Version:
Flutter 0.5.1
camera: "^0.2.1"
image_picker: "^0.4.5"
Steps To Reproduce,
- Create a Stack view with CameraPreview with 2 button to capture and open gallery
- Click on open gallery button (At first time it asks for permission click allow -> CRASHED)
open gallery by usingfinal File galleryImagePath = await ImagePicker.pickImage(source:ImageSource.gallery);
sample code to Reproduce CameraView - sample code
NarHakobyan, aloisdeniel, rodolfoggp, HosseinArabbeigi, jdeltoft and 16 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.p: cameraThe camera pluginThe camera pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.