Lassi-Android icon indicating copy to clipboard operation
Lassi-Android copied to clipboard

Camera opening crash the app

Open vedpawar opened this issue 3 years ago • 1 comments

When we try to open camera in different activity in the app, it is crashing the app and gives this error.

java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera/.Camera clip={text/uri-list {...}} (has extras) } from ProcessRecord{deaa3a2 13274:com.ved.testapp/u0a728} (pid=13274, uid=10728) with revoked permission android.permission.CAMERA

If we remove this library camera working properly. I have not given any CAMERA permission in manifest.

I have also added implementation 'com.github.livefront:bridge:v2.0.2' this permission explicitly because you used older version of this library and it gives error in pure kotlin project when we not used jetifier.

vedpawar avatar Sep 30 '22 09:09 vedpawar

Hello @vedpawar

Thank you for using the Lassi library. We have tried to generate the issue based on your given description but we are unable to regenerate it. It would be great if you provide below details:

  • Library version
  • Code snippet
  • Device specification like (Manufacturer, OS version, etc)
  • Screenshot/video with steps to reproduce the issue

Thank you

sanjay-mi avatar Oct 12 '22 06:10 sanjay-mi

Hello @sanjay-mi Recently I have upgraded lassi library version from 1.0.1 to 1.1.0 but still I am getting the same error. My device details are: Brand:Xiaomi Model:Mi A3 / Redmi Note 8 Pro Version:Android 11

Code Snippet:

   // start picker to get image for cropping and then use the image in cropping activity 
    cropImage.launch(
        options {
            setGuidelines(CropImageView.Guidelines.ON)
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
                setOutputCompressFormat(Bitmap.CompressFormat.WEBP_LOSSLESS)
            } else {
                setOutputCompressFormat(Bitmap.CompressFormat.WEBP)
            }
        }
    )



// receiver to handle the image      
private val cropImage = registerForActivityResult(CropImageContract()) { result ->
    if (result.isSuccessful) {
        // use the returned uri
        val uriContent = result.uriContent
        binding.imgProfile.loadUriRounded(
            uriContent!!,
            R.drawable.ic_user_icon
        )
        updateProfile()
    } else {
        // an error occurred
        val exception = result.error
        exception?.printStackTrace()
        Timber.e(exception)
    }
}

I am getting this exception: Fatal Exception: java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera/.Camera clip={text/uri-list {...}} (has extras) } from ProcessRecord{5644f5b 20016:com.example.testapp/u0a568} (pid=20016, uid=10568) with revoked permission android.permission.CAMERA

vedpawar avatar Feb 20 '23 12:02 vedpawar

Hello @vedpawar

Thank you for using the Lassi library.

We have released a new version 1.2.0 Please try that and let us know still the issue persists or not.

Thank you

sanjay-mi avatar May 16 '23 09:05 sanjay-mi