PixImagePicker icon indicating copy to clipboard operation
PixImagePicker copied to clipboard

Android 13 Permission issue ,Please tell me what is missing in my code

Open pradip-android opened this issue 1 year ago • 4 comments

Describe the bug i gave the all permission but still showed permission denied dialog.

My Manifest permission   <uses-permission android:name="android.permission.CAMERA" />    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />    <uses-permission        android:name="android.permission.WRITE_EXTERNAL_STORAGE"        android:maxSdkVersion="28" />    <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />

My kotlin code `binding.fab.setOnClickListener { view ->

        val options = Options().apply{
            ratio = Ratio.RATIO_AUTO                                    //Image/video capture ratio
            count = 15                                                   //Number of images to restrict selection count
            spanCount = 4                                               //Number for columns in grid
            path = "Pix/Camera"                               //Custom Path For media Storage
            isFrontFacing = false
            mode = Mode.All                                             //Option to select only pictures or videos or both
            flash = Flash.Auto                                          //Option to select flash type
            preSelectedUrls = ArrayList<Uri>()                          //Pre selected Image Urls
        }

        addPixToActivity(R.id.container, options) { it ->
            when (it.status) {
                PixEventCallback.Status.SUCCESS -> //use results as it.data
                {

                    val returnValue = it.data
                    Log.e("", "onActivityResult: ${returnValue.size}")
                   }
                PixEventCallback.Status.BACK_PRESSED -> // back pressed called
                {}
            }
        }

    }`

gradle file `dependencies {

implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.7.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation  'io.ak1.pix:piximagepicker:1.6.3'

}`

Screenshots Please find the screenshot Screenshot 2023-09-27 at 7 09 56 PM

Device information

  • Device: [e.g. Realme ]
  • OS: [e.g. 13]

pradip-android avatar Sep 27 '23 13:09 pradip-android

@pradip-android I am also facing this same issue. Did you find any fix or any similar library that provides these implementation with latest api?

mukul-kr avatar Oct 19 '23 12:10 mukul-kr

I hope we can get the replacement

arifaizin avatar Nov 22 '23 00:11 arifaizin

This is happening because in Android 13 and above android.permission.READ_EXTERNAL_STORAGE is replaced with android.permission.READ_MEDIA_IMAGES/VIDEOS. But this repo has not updated "PermissionHelper" Class.

Rayhan-kh avatar Jan 04 '24 12:01 Rayhan-kh

is there any fixes for this?

heskadon avatar Mar 09 '24 05:03 heskadon

This has been updated and will be available in next release.

akshay2211 avatar Jun 26 '24 16:06 akshay2211