LuckSiege / LuckSiege/PictureSelector

关于targetSdk修改为34后权限已获取,但是PictureSelectorActivity拿不到权限出现提示框

Open
#3,012 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
13.6k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

picture_library:2.6.1 版本。升级gradle 8.9修改targetSdk = 34出现问题,具体是已请求权限跳转后还提示权限失败。用的XXPermissions:26.5请求权限库
reqPermissions(arrayListOf(
PermissionLists.getReadMediaAudioPermission(),
PermissionLists.getReadMediaImagesPermission(),
PermissionLists.getReadMediaVideoPermission(),
PermissionLists.getCameraPermission())){
showPop()
}
请求完后 PictureSelectorActivity中
protected void onResume() {
super.onResume();
if (isEnterSetting) {
if (PermissionChecker
.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) &&
PermissionChecker
.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
if (mAdapter.isDataEmpty()) {
readLocalMedia();
}
} else {
showPermissionsDialog(false, getString(R.string.picture_jurisdiction));
}
isEnterSetting = false;
}

if (config.isOriginalControl) {
if (mCbOriginal != null) {
mCbOriginal.setChecked(config.isCheckOriginalImage);
}
}
}

获取不到权限。官方环境在低版本gradle中没问题。
你官方例子gradle环境不一样targetSdk也不一样,修改环境总是缺文件无法在gradle8.9环境试验是否成功。
showPermissionsDialog提示框去设置权限,也无法获取图片。个人感觉是权限获取有问题

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with PictureSelectorActivity.onResume and trace the PermissionChecker checks for READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE after the XXPermissions request using targetSdk 34. Compare those checks with the permissions requested through PermissionLists and verify the result on the Gradle 8.9 setup; done means an approved request does not trigger showPermissionsDialog and media can be loaded.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.