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

Android 13 - Image and Video selection from camera is buggy #1152

Closed
2 tasks
1t5j0y opened this issue Oct 24, 2023 · 9 comments
Closed
2 tasks

Android 13 - Image and Video selection from camera is buggy #1152

1t5j0y opened this issue Oct 24, 2023 · 9 comments
Assignees
Labels

Comments

@1t5j0y
Copy link
Contributor

1t5j0y commented Oct 24, 2023

Describe the bug

  1. User is not prompted for camera permission and needs to go to OS settings for Avni app and explicitly provide permission for camera to work.
  2. For form element of type video, after recording the video, there is no way to go back to the app.

To Reproduce
See video:
https://github.com/avniproject/avni-client/assets/54208632/bd311c34-1247-43b1-97ae-d616c95e85f6

Analysis details:

  • Issue exists in 5.0.4(already released) as well
  • User can continue uploading image/video from folder
  • Issue not occurring in android 10 version and might not occur in other versions as well
  • So not a high priority for 5.1.0 release

Expected behavior
User should be prompted for camera permission in app if not already provided.
User should be able to come back to the Avni app after recording a video triggered from a video form element.

Smartphone (please complete the following information):

  • OS: Android 13

Developer Checklist
Developer fixing the bug should fill this checklist.

  • Does the fix require extensive regression testing?
  • Are you mentioning the required scenarios that could be affected?
@1t5j0y 1t5j0y moved this to New Issues in Avni Product Oct 24, 2023
@mahalakshme mahalakshme moved this from New Issues to Triaging analysis in Avni Product Oct 27, 2023
@mahalakshme mahalakshme moved this from Triaging analysis to Ready in Avni Product Nov 2, 2023
@ashusvnath ashusvnath self-assigned this Nov 2, 2023
@ashusvnath ashusvnath moved this from Ready to In Progress in Avni Product Nov 2, 2023
@ashusvnath
Copy link

@mahalakshme This seems to be the case with current 5.1.0 build also

@ashusvnath
Copy link

The first media capture succeeds (be it image or video), all following media captures fail.

@ashusvnath
Copy link

This problem exists both on emulator and actual phones

@ashusvnath
Copy link

exception captured from Android logs.

FATAL EXCEPTION: main

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.content.ContentValues.put(java.lang.String, java.lang.Long)' on a null object reference

FATAL EXCEPTION: main
Process: com.android.camera2, PID: 11529
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.content.ContentValues.put(java.lang.String, java.lang.Long)' on a null object reference
	at com.android.camera.VideoModule.saveVideo(VideoModule.java:1263)
	at com.android.camera.VideoModule.stopVideoRecording(VideoModule.java:1513)
	at com.android.camera.VideoModule.onStopVideoRecording(VideoModule.java:656)
	at com.android.camera.VideoModule.onInfo(VideoModule.java:1296)
	at android.media.MediaRecorder$EventHandler.handleMessage(MediaRecorder.java:1622)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7872)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@ashusvnath
Copy link

Similar issue found in Android 13 : flutter/flutter#118443

@ashusvnath
Copy link

Video capture returns a response where didCancel is true. Root cause seems to be Exception listed above.

@ashusvnath
Copy link

A workaround exists.
User can record video directly using camera and choose the appropriate media file for the form element.

@ashusvnath
Copy link

Issue persists after upgarding to react-native-image-picker version 7.0.2.

@ashusvnath ashusvnath moved this from In Progress to Hold in Avni Product Nov 6, 2023
@ashusvnath ashusvnath moved this from Hold to Code Review Ready in Avni Product Nov 7, 2023
@ashusvnath
Copy link

Created issue #1174 to track inability to capture video from app.
The code changes are in branch 5.1.0 because that is affected too.

@1t5j0y 1t5j0y moved this from Code Review Ready to In Code Review in Avni Product Nov 7, 2023
@1t5j0y 1t5j0y moved this from In Code Review to QA Ready in Avni Product Nov 7, 2023
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Nov 7, 2023
@AchalaBelokar AchalaBelokar moved this from In QA to Done in Avni Product Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants