Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]:提示我删除maxSdkVersion="32",但是全局都没有搜索到这个 #294

Closed
liguangze opened this issue May 29, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@liguangze
Copy link

框架版本【必填】

16.6

问题描述【必填】

The AndroidManifest.xml file does not meet the requirements, please delete the android:maxSdkVersion="32" attribute

这个是全部的错误信息,但是我在AndroidManifest.xml并没有设置android:maxSdkVersion="32",我全局搜索都没有这个maxSdkVersion

复现步骤【必填】

下载获取文件的时候,获取存储权限
if (!XXPermissions.isGranted(ClassDetailVideoActivity.this, Permission.Group.STORAGE)) {
XXPermissions.with(ClassDetailVideoActivity.this)
// 不适配 Android 11 可以这样写
//.permission(Permission.Group.STORAGE)

                                .permission(Permission.Group.STORAGE)

这个代码就回去报上面的错误

是否必现【必填】

项目 targetSdkVersion【必填】

30

出现问题的手机信息【必填】

华为

出现问题的安卓版本【必填】

8.0

问题信息的来源渠道【必填】

自己遇到的

是部分机型还是所有机型都会出现【必答】

华为手机必现

框架最新的版本是否存在这个问题【必答】

框架文档是否提及了该问题【必答】

是否已经查阅框架文档但还未能解决的【必答】

issue 列表中是否有人曾提过类似的问题【必答】

是否已经搜索过了 issue 列表但还未能解决的【必答】

是否可以通过 Demo 来复现该问题【必答】

提供报错堆栈

The AndroidManifest.xml file <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" /> does not meet the requirements, please delete the android:maxSdkVersion="32" attribute

提供截图或视频

提供解决方案

@liguangze liguangze added the bug Something isn't working label May 29, 2024
@liguangze
Copy link
Author

在清单文件中静态注册权限的时候,不要带上 maxSdkVersion 属性,这样就不会触发框架的检测异常

在权限申请的时候,调用 .unchecked() 方法,表示不会进行任何权限检查,这样就不会触发框架的检测异常

解决办法是这两个,可我清单文件中静态注册权限的时候,根本没有带上 maxSdkVersion 属性。为什么提示我这个呢,
而且之前一直在用,都没有问题,就今天开始报错了

@getActivity
Copy link
Owner

你反编译 apk 看一下 AndroidManifest.xml 是否有加 maxSdkVersion 属性?

@liguangze
Copy link
Author

111
反编译之后的结果,并没有maxSdkVersion这个属性呢

@getActivity
Copy link
Owner

image

@getActivity
Copy link
Owner

你测试过了最新版本也有这个问题?

@liguangze
Copy link
Author

是了一下,新版本也是不行,但是我打成正式包没有问题,我运行正式包就会有这个问题,混淆的原因?

@getActivity
Copy link
Owner

是了一下,新版本也是不行,但是我打成正式包没有问题,我运行正式包就会有这个问题,混淆的原因?

这是因为检测机制只在 Debug 包下生效,Release 包下不会生效。

@getActivity
Copy link
Owner

@liguangze 你把项目的框架升级到最新版本,然后打一个 apk 上传到这里,并告知 App 上面的复现步骤,我这边来复现一下问题。

@liguangze
Copy link
Author

感谢开源,不纠结这个问题了,添加这个方法 .unchecked() 方法可以解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants