App crash when camera lunch, no logs showing in the log cat related to the camera issue

52 views Asked by At

When I lunch camera from app some time crash some time working on Android 12+ devices

 Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                    intent.putExtra(MediaStore.EXTRA_OUTPUT, GeneralFunctions.setImageUri(DAcitivity.this));
                    startActivityForResult(intent, ConstantVariables.IMAGE_REQUEST_CODE);
  1. Added below permission i. Camera permission : Sometimes if even after accepting permission, ii. External storage iii. Read External storage iv. android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION

Camera permission : Sometimes if even after accepting permission, showing permission denied.

  if (ContextCompat.checkSelfPermission(DocCollectionActivity.this,
                        Manifest.permission.CAMERA)!= PackageManager.PERMISSION_GRANTED) {
                    Log.e(TAG, "onCameraClickListener: Permission granted");
                }

There are no logs showing in the log cat related to the camera issue, and the debugger gets disconnected after lunching the camera as well.

1

There are 1 answers

0
komal Mane On

Issue Is With Software? Try These Fixes.

1. Open the Settings app on your Android device. Go to Apps and select Camera from the list of installed apps. After that, tap on Storage. Then, tap on the Clear cache option.
2. Go to Settings > Apps and select Camera. Then, tap on Force stop.
3. If nothing else works, reset your Android device to its default settings as a last resort. Be sure to take a backup before going for this option, as it wipes out all documents, media, contacts, text messages, and everything else stored on your phone.