Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Video recording not work in android #179

Closed
heshesh2010 opened this issue Jun 27, 2023 · 4 comments
Closed

[BUG] Video recording not work in android #179

heshesh2010 opened this issue Jun 27, 2023 · 4 comments
Labels
i: duplicate This issue or pull request already exists

Comments

@heshesh2010
Copy link

heshesh2010 commented Jun 27, 2023

Hi ,
I'm using latest version 3.8.0

E/MethodChannel#plugins.flutter.io/camera_android(18473): java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Surface android.media.MediaRecorder.getSurface()' on a null object reference
E/MethodChannel#plugins.flutter.io/camera_android(18473): at io.flutter.plugins.camera.Camera.startCapture(Camera.java:535)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at io.flutter.plugins.camera.Camera.startVideoRecording(Camera.java:764)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at io.flutter.plugins.camera.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:122)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at android.os.Handler.handleCallback(Handler.java:942)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at android.os.Looper.loopOnce(Looper.java:226)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at android.os.Looper.loop(Looper.java:313)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at android.app.ActivityThread.main(ActivityThread.java:8757)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/MethodChannel#plugins.flutter.io/camera_android(18473): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
E/flutter (18473): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: CameraException(videoRecordingFailed, prepare failed:-12)
E/flutter (18473): #0 handleErrorWithHandler
methods.dart:28
E/flutter (18473): #1 CameraPickerState.startRecordingVideo
camera_picker_state.dart:701
E/flutter (18473):
E/flutter (18473):
E/DartMessenger(18473): Uncaught exception in binary message listener
E/DartMessenger(18473): java.lang.IllegalStateException: Reply already submitted
E/DartMessenger(18473): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:435)
E/DartMessenger(18473): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:278)
E/DartMessenger(18473): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/DartMessenger(18473): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/DartMessenger(18473): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/DartMessenger(18473): at android.os.Handler.handleCallback(Handler.java:942)
E/DartMessenger(18473): at android.os.Handler.dispatchMessage(Handler.java:99)
E/DartMessenger(18473): at android.os.Looper.loopOnce(Looper.java:226)
E/DartMessenger(18473): at android.os.Looper.loop(Looper.java:313)
E/DartMessenger(18473): at android.app.ActivityThread.main(ActivityThread.java:8757)
E/DartMessenger(18473): at java.lang.reflect.Method.invoke(Native Method)
E/DartMessenger(18473): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/DartMessenger(18473): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
I/ViewRootImpl@dc47214MainActivity: ViewPostIme pointer 1
I/MediaRecorderJNI(18473): finalize

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F82 darwin-x64, locale en-EG)
! Warning: dart on your path resolves to /usr/local/Cellar/dart/2.18.4/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/hesham/flutter. Consider adding /Users/hesham/flutter/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.79.2)
[✓] Connected device (2 available)
[✓] Network resources

@heshesh2010 heshesh2010 added the await investigate The issue is waiting for further investigation. label Jun 27, 2023
@MutongXiao
Copy link

I had the same issue, it seems to be caused by a problem with the camera package, I upgraded the camera_android package and then this plugin works fine on Android 13 devices.

Reference link: flutter/flutter#109769

@AlexV525
Copy link
Member

AlexV525 commented Jul 5, 2023

Duplicate of #147

@AlexV525 AlexV525 marked this as a duplicate of #147 Jul 5, 2023
@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2023
@AlexV525 AlexV525 added i: duplicate This issue or pull request already exists s: invalid and removed await investigate The issue is waiting for further investigation. labels Jul 5, 2023
@MutongXiao
Copy link

不知道是不是camera这个包已经更新了,camera_android这个包好像修复了在安卓13出现空指针这个问题,我直接将camera_android升级到了最新版本,然后插件居然能运行了,作者是否考虑更新一下这个插件呢?

@AlexV525
Copy link
Member

AlexV525 commented Jul 6, 2023

作者是否考虑更新一下这个插件呢?

flutter/flutter#109769 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants