PixImagePicker
PixImagePicker copied to clipboard
Android 13 Permission issue ,Please tell me what is missing in my code
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
Device information
- Device: [e.g. Realme ]
- OS: [e.g. 13]
@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?
I hope we can get the replacement
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.
is there any fixes for this?
This has been updated and will be available in next release.