Giter Club home page Giter Club logo

permissionx's Introduction

PermissionX

中文文档

PermissionX is an extension Android library that makes Android runtime permission request extremely easy. You can use it for basic permission request occasions or handle more complex conditions, like showing rationale dialog or go to app settings for allowance manually.

Quick Setup

Edit your build.gradle file and add below dependency.

repositories {
  google()
  mavenCentral()
}

dependencies {
    implementation 'com.guolindev.permissionx:permissionx:1.8.0'
}

That's all. Now you are ready to go.

Basic Usage

Use PermissionX to request Android runtime permissions is extremely simple.

For example. If you want to request READ_CONTACTS, CAMERA and CALL_PHONE permissions, declared them in the AndroidManifest.xml first.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.permissionx.app">

	<uses-permission android:name="android.permission.READ_CONTACTS" />
	<uses-permission android:name="android.permission.CAMERA" />
	<uses-permission android:name="android.permission.CALL_PHONE" />

</manifest>

Then you can use below codes to request.

PermissionX.init(activity)
    .permissions(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA, Manifest.permission.CALL_PHONE)
    .request { allGranted, grantedList, deniedList ->
        if (allGranted) {
            Toast.makeText(this, "All permissions are granted", Toast.LENGTH_LONG).show()
        } else {
            Toast.makeText(this, "These permissions are denied: $deniedList", Toast.LENGTH_LONG).show()
        }
    }

Pass any instance of FragmentActivity or Fragment into init method, and specify the permissions that you want to request in the permissions method, then call request method for actual request.

The request result will be callback in the request lambda. allGranted means if all permissions that you requested are granted by user, maybe true or false. grantedList holds all granted permissions and deniedList holds all denied permissions.

Now you can write your own logic in the request lambda to handle the specific cases of your app.

More Usage

As you know, Android provide shouldShowRequestPermissionRationale method to indicate us if we should show a rationale dialog to explain to user why we need this permission. Otherwise user may deny the permissions we requested and checked never ask again option.

To simplify this process, PermissionX provide onExplainRequestReason method. Chain this method before request method, If user deny one of the permissions, onExplainRequestReason method will get callback first. Then you can call showRequestReasonDialog method to explain to user why these permissions are necessary like below.

PermissionX.init(activity)
    .permissions(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA, Manifest.permission.CALL_PHONE)
    .onExplainRequestReason { scope, deniedList ->
        scope.showRequestReasonDialog(deniedList, "Core fundamental are based on these permissions", "OK", "Cancel")
    }
    .request { allGranted, grantedList, deniedList ->
        if (allGranted) {
            Toast.makeText(this, "All permissions are granted", Toast.LENGTH_LONG).show()
        } else {
            Toast.makeText(this, "These permissions are denied: $deniedList", Toast.LENGTH_LONG).show()
        }
    }

showRequestReasonDialog method will prompt a rationale dialog with the information that second parameter provide. If user click positive button which shows text as third parameter provide, PermissionX will request again with the permissions that first parameter provide.

The fourth parameter as text for negative button is optional. If the denied permissions are necessary, you can ignore the fourth parameter and the dialog will be uncancelable. Which means user must allow these permissions for further usage.

Of course, user still may deny some permissions and checked never ask again option. In this case, each time we request these permissions again will be denied automatically. The only thing we could do is prompt to users they need to allow these permissions manually in app settings for continuation usage. But PermissionX did better.

PermissionX provide onForwardToSettings method for handling this occasion. Chain this method before request method, If some permissions are "denied and never ask again" by user, onForwardToSettings method will get callback. Then you can call showForwardToSettingsDialog method like below.

PermissionX.init(activity)
    .permissions(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA, Manifest.permission.CALL_PHONE)
    .onExplainRequestReason { scope, deniedList ->
        scope.showRequestReasonDialog(deniedList, "Core fundamental are based on these permissions", "OK", "Cancel")
    }
    .onForwardToSettings { scope, deniedList ->
        scope.showForwardToSettingsDialog(deniedList, "You need to allow necessary permissions in Settings manually", "OK", "Cancel")
    }
    .request { allGranted, grantedList, deniedList ->
        if (allGranted) {
            Toast.makeText(this, "All permissions are granted", Toast.LENGTH_LONG).show()
        } else {
            Toast.makeText(this, "These permissions are denied: $deniedList", Toast.LENGTH_LONG).show()
        }
    }

The parameters in onForwardToSettings method are similar with showRequestReasonDialog method. When user click positive button, PermissionX will forward to the settings page of your app and user can turn on the necessary permissions very quickly. When user switch back to app, PermissionX will request the necessary permissions again automatically.

Explain Before Request

It is always a good manner to show the rationale dialog and explain to users why you need these permissions before you actually request them.

To do that with PermissionX is quite simple. Just use explainReasonBeforeRequest method like below.

PermissionX.init(activity)
    .permissions(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA, Manifest.permission.CALL_PHONE)
    .explainReasonBeforeRequest()
    ...

Now everything works like charm.

Dark Theme

The rationale dialog provided by PermissionsX support Android dark theme automatically. If you change your device into dark theme, everything just works great.

License

Copyright (C) guolin, PermissionX Open Source Project

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

permissionx's People

Contributors

guolindev avatar guolindevs avatar sinyu890807 avatar zcc1234567 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

permissionx's Issues

引入PermissionX使用打包时会出现More than one file was found with OS independent path 'META-INF/library_release.kotlin_module'

很感谢郭神写的库。
上面引起的原因是因为使用Kotlin 会自动创建META-INF/library_release.kotlin_module 文件。可能会和其他库出现冲突。有的解决方案是
android {
.........
packagingOptions {
exclude 'META-INF/library_release.kotlin_module'
}
}
但是这个对我没作用,因为我本地有一个library库,和你的库名字一样了,然后生成的也一样了,就报错了,我用这种方式的话,会导致项目不能用,我现在把本地的库名字改了,就可以了。
不过这个可以在库上解决根本原因,这样就避免了让每个人都添加排除修复程序:
ChuckerTeam/chucker#134

Android 11

是不是没有适配Android11啊,MANAGE_EXTERNAL_STORAGE申请有问题,不弹窗直接拒绝

【建议】PermissionX 和 kotlin 版本关联,建议文档里添加版本对应说明

因为PermissionX依赖特定的kotlin版本,可能出现引入的PermissionX所依赖的kotlin版本和当前工程已经在用的kotlin版本不一致,导致编译失败,出现 Cause: duplicate entry: module-info.class 问题。
比如我当前使用的kotlin版本为1.3.72,引入1.4.0版本的permissionx,就出现了上面的问题。而kotlin版本又和gradle插件乃至Android Studio版本都一定关联,所以有时候还不能通过简单地修改一下使用的kotlin版本来解决。

建议郭神在文档里添加版本对应说明,比如工程使用什么版本的kotlin时,应该使用哪个版本的permissionx。虽然对有经验的开发者来说,不是特别难解决的问题,但我觉得对比较初级的朋友们来说会更友好一点。仅仅是一个建议。

这里应该会crash吧

PermissionBuilder #getInvisibleFragment,

private fun getInvisibleFragment(): InvisibleFragment {
    ...
    fragmentManager.beginTransaction().add(invisibleFragment, TAG).commitNow() //此处是不是应该判断StateSaved状态, 或者改成commitNowAllowingStateLoss
}

positiveText, negativeText设置按钮文案不显示

依赖 permissionx:1.2.2
...
scope.showRequestReasonDialog(deniedList, “需要您同意以下权限才能正常使用”, "允许请求", "我还是拒绝")
...
权限被拒绝时,弹默认dialog,设置的确认、拒绝按钮文案没有正常显示

Caused by: java.lang.IllegalStateException: FragmentManager is already executing transactions

在ViewPager的其中一个fragment中使用PermissionX出现了以下报错:

Caused by: java.lang.IllegalStateException: FragmentManager is already executing transactions
at androidx.fragment.app.FragmentManagerImpl.ensureExecReady(FragmentManagerImpl.java:1660)
at androidx.fragment.app.FragmentManagerImpl.execSingleAction(FragmentManagerImpl.java:1692)
at androidx.fragment.app.BackStackRecord.commitNow(BackStackRecord.java:293)
at com.permissionx.guolindev.request.PermissionBuilder.getInvisibleFragment(PermissionBuilder.java:275)
at com.permissionx.guolindev.request.PermissionBuilder.requestNow(PermissionBuilder.java:252)
at com.permissionx.guolindev.request.RequestNormalPermissions.request(RequestNormalPermissions.java:62)
at com.permissionx.guolindev.request.RequestChain.runTask(RequestChain.java:55)

Android10,请求多个权限,仅弹出第一个权限请求

机型:荣耀20 Lite Android10
请求多个权限,仅第一个权限弹出是否开启,其余权限均默认永久关闭,请求示例如下:
PermissionX.init(activity)
.permissions(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)
//被用户临时拒绝,查看拒绝选项,走此方法
.onExplainRequestReason { deniedList ->
// val filteredList = deniedList.filter {
// it == Manifest.permission.CAMERA
// }
showRequestReasonDialog(deniedList, "头像设置需要的权限", "我已明白", "取消")
}
//被用户永久拒绝不提醒,走这个方法
.onForwardToSettings { deniedList ->
showForwardToSettingsDialog(deniedList, "您需要去应用程序设置当中手动开启权限", "我已明白", "取消")
}
//allGranted表示是否所有申请的权限都已被授权,grantedList用于记录所有已被授权的权限,deniedList用于记录所有被拒绝的权限
.request { allGranted, _, deniedList ->
if (allGranted) {
singleImg(activity)
} else {
ToastUtil.showShort("您拒绝了如下权限:$deniedList")
}
}

OPPOr15进行相机权限申请时直接拒绝,并没有弹出询问Dialog,是否我的调用有问题

PermissionX.init(this)
.permissions(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)
/.onExplainRequestReason(new ExplainReasonCallbackWithBeforeParam() {
@OverRide
public void onExplainReason(ExplainScope scope, List deniedList, boolean beforeRequest) {
scope.showRequestReasonDialog(deniedList, "即将申请的权限是程序必须依赖的权限", "我已明白");
}
})
/
/* .onForwardToSettings(new ForwardToSettingsCallback() {
@OverRide
public void onForwardToSettings(ForwardScope scope, List deniedList) {
scope.showForwardToSettingsDialog(deniedList, "您需要去应用程序设置当中手动开启权限", "我已明白");
}
})*/
.request(new RequestCallback() {
@OverRide
public void onResult(boolean allGranted, List grantedList, List deniedList) {
if (allGranted) {
new CameraUtil(getContext()).showCamera();
Toast.makeText(MainActivity.this, "所有申请的权限都已通过", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(MainActivity.this, "您拒绝了如下权限:" + deniedList, Toast.LENGTH_SHORT).show();
}
}
});
});

Webview中上传文件时onShowFileChooser中请求权限的问题

郭神您好!提个问题,

在Webview中点击网页上传按钮,onShowFileChooser中请求权限时,拒绝和不再提示都不会弹出reason或rational弹窗,即使同意了也没有走到onResult回调中,需要再次点击才能弹出权限框或者文件选择器,而且如果之前选择了不再提示,之后点击上传将没有响应。代码如下:

private boolean hasPermission = false;

@Override
public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> valuesCallback, WebChromeClient.FileChooserParams params) {
        ......
        PermissionX.init(WebViewAct.this)
                .permissions(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA)
                .onExplainRequestReason(...)
                .onForwardToSettings(...)
                .request(new RequestCallback() {
                    @Override
                    public void onResult(boolean allGranted, List<String> grantedList, List<String> deniedList) {
                            if (allGranted) {
                                    getFile(webView.getUrl(), acceptType);
                            }
                            hasPermission = allGranted; 
                    }
                });
        return hasPermission;
}

呼叫转移权限不能自动获取

安装完软件后,用户确认了所有的权限,但是这个呼叫转移权限,却不能自动打开。必须手动去权限处打开。有什么办法解决么?

图片

安卓老版本是可以提醒用户获取的(应该是6.0以下版本)
图片

蓝牙权限有问题

请求蓝牙(Manifest.permission.BLUETOOTH)权限的时候,用户还没点击授权或者拒绝,就直接进入request的回调函数

多个权限同时申请的顺序

版本1.4.0
存储权限,定位权限,同时申请,定位永远在前面,不管我在程序中按什么顺序写的.
应该是以下代码改变了原来list的顺序
PermissionCollection 类中:
public PermissionBuilder permissions(List permissions) {
Set permissionSet = new HashSet<>(permissions);
...
}

kotlin.UninitializedPropertyAccessException

由InvisibleFragment private lateinit PermissionBuilder 引发 kotlin.UninitializedPropertyAccessException 异常 关键字lateinit 引起 导致未初始化成功 permissionBuilder 为Null

通讯录没有给权限,然后PermissionX却回调回来权限是通过的

最近在开发关于读取通讯录的一款App,在开发的过程当中,先使用了PermissionX进行请求可以读写通讯录的操作权限

PermissionUtil.checkContacts(activity,(allGranted, grantedList, deniedList) -> {
                                if (allGranted){
                                   Log.i(TAG,"权限通过");
                                }
                            });
  • Manifest.permission.READ_CONTACTS
  • Manifest.permission.WRITE_CONTACTS
  • Manifest.permission.GET_ACCOUNTS

主要读取了以上的权限,但是回调回来的结果竟然是通过,导致项目多次无法正常的运行

现在又抓紧时间使用了其他的方式进行了权限的请求,还望做着可以查一下为什么会出现这样的问题

能否添加自定义权限申请框功能

郭神 有没有可能添加 自定义权限申请框功能,我在工程里引用了 但是自定义的好像是 授权前的提示框 和 拒绝后的说明框 ,实际申请权限那个dialog 能否也能自定义

【崩溃BUG】申请两个权限,将其中一个”禁止后不再提醒“,然后去应用设置将被允许的权限也禁止,再返回App直接崩溃

复现操作:
(1) 点击按钮弹出RequestReasonDialog,点击确定。
(2) 允许存储权限,拒绝相机权限。此时会再次弹出RequestReasonDialog。
(3) 点击确定,然后点击禁止后不再提示。此时会弹出ForwardToSettingsDialog。
(4) 点击确定,然后在应用程序权限设置中禁止存储权限。
(5) 再次返回App,App崩溃。

核心代码如下:
PermissionX.init(this)
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.CAMERA)
.explainReasonBeforeRequest()
.onExplainRequestReason(new ExplainReasonCallback() {
@OverRide
public void onExplainReason(ExplainScope scope, List deniedList) {
String message = "该功能需要您同意以下权限才能正常使用";
scope.showRequestReasonDialog(deniedList, message,
"确定", "取消");
}
})
.onForwardToSettings(new ForwardToSettingsCallback() {
@OverRide
public void onForwardToSettings(ForwardScope scope, List deniedList) {
scope.showForwardToSettingsDialog(deniedList,
"您需要去应用程序设置中手动开启以下权限",
"确定", "取消");
}
})
.request(new RequestCallback() {
@OverRide
public void onResult(boolean allGranted, List grantedList, List deniedList) {
if (allGranted) {
}
}
});

1.4.0版本依赖添加导致多语言资源文件切换失效

郭神,在添加1.4.0版本依赖后,我在Activity中重写attachBaseContext方法切换多语言资源文件的方法会失效但没有报错,即Activity级的Resources切换失败,但是Application级的Resources是能成功切换的,说明代码没有问题。
将依赖版本切换回1.3.0版本则没有这个问题,我测试的时候没有使用PermissionX的方法,仅仅添加依赖就会出现这个问题,求解啊

Android 10的ACCESS_BACKGROUND_LOCATION权限未兼容

mi mix3 android 10版本
targetSdkVersion=29

PermissionX.init(this)
.permissions(ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION, ACCESS_BACKGROUND_LOCATION)
.request { allGranted, grantedList, deniedList ->
    println("grantedList:$grantedList")
    println("deniedList:$deniedList")
    ......
}

当点击“仅在使用时访问”,权限被判断为拒绝,日志如下

grantedList:[android.permission.ACCESS_FINE_LOCATION, android.permission.ACCESS_COARSE_LOCATION]
deniedList:[android.permission.ACCESS_BACKGROUND_LOCATION]

魅蓝note5 拒绝后跳转设置页面,手动设置权限后返回程序崩溃

Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=131074, result=0, data=null} to activity {com.**/com.ui.activity.backstagesetting.tabmanage.BasicInfoactivity}: kotlin.UninitializedPropertyAccessException: lateinit property permissionBuilder has not been initialized
at android.app.ActivityThread.deliverResults(ActivityThread.java:4333)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3602)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3680) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2924) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1628) 
at android.os.Handler.dispatchMessage(Handler.java:110) 
at android.os.Looper.loop(Looper.java:203) 
at android.app.ActivityThread.main(ActivityThread.java:6406) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:974) 
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property permissionBuilder has not been initialized
at com.permissionx.guolindev.InvisibleFragment.onActivityResult(InvisibleFragment.kt:168)
at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:170)

android11权限问题

我的三星android11申请位置权限申请不到把targetSdkVersion改到29就可以了,麻烦解答下
private String[] mPermissions = {
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.CAMERA,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_BACKGROUND_LOCATION
};
这是我申请的权限

Cause: zip file is empty

引入了PermissionX后Studio老是报 Cause: zip file is empty。升级了Studio(4.0.2)和gradle(6.6.1)之后又报No such property: variantConfiguration for class: com.android.build.gradle.internal.variant.ApplicationVariantData。
后来发现PermissionX的commit记录中有一条“Do not upgrade to gradle plugin 4.0 for now.”
遂放弃PermissionX,哭唧唧。

PermissionX为何不走request?

我添加权限Manifest.permission.SYSTEM_ALERT_WINDOW,允许访问权限后走的是onForwardToSettings()方法,不是走request()方法,如果不添加Manifest.permission.SYSTEM_ALERT_WINDOW权限,就成功,否则失败

NullPointerException

java.lang.NullPointerException:Attempt to read from field 'java.util.Set k.n.a.d.e.h' on a null object reference

com.permissionx.guolindev.request.InvisibleFragment.d3(InvisibleFragment.java:1)

com.permissionx.guolindev.request.InvisibleFragment.onRequestPermissionsResult(InvisibleFragment.java:1)

androidx.fragment.app.FragmentActivity.onRequestPermissionsResult(FragmentActivity.java:6)

android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8566)

在引导页请求定位权限,在 onCreated 触发权限请求。

不知道用户怎么操作的,出现空指针。

引导页跟踪生命周期:onCreated ----》onResumed -----》onPaused

机型:

三星 SM G975F Android 10,level 29

华为 LYA L29 Android 10,level 29

@guolindev

空指针异常

首先说明框架没问题,是我用的问题,由于水平较低,不知道怎么处理是比较稳妥的,所以提个问题。Demo中 是在按钮点击时间里面去应用的框架,CustomDialogFragment 弹窗是没问题的,但是我们需求是启动activity后 去检测权限,所以我直接把代码放到onCreate 中,
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_java);
PermissionX.init(MainJavaActivity.this)
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.explainReasonBeforeRequest()
.onExplainRequestReason(new ExplainReasonCallbackWithBeforeParam() {
@OverRide
public void onExplainReason(ExplainScope scope, List deniedList, boolean beforeRequest) {
CustomDialogFragment dialog = new CustomDialogFragment("请允许权限选择", deniedList);
scope.showRequestReasonDialog(dialog);
}
}).onForwardToSettings(new ForwardToSettingsCallback() {
@OverRide
public void onForwardToSettings(ForwardScope scope, List deniedList) {
CustomDialogFragment dialog = new CustomDialogFragment("请允许权限选择,去设置", deniedList);
scope.showForwardToSettingsDialog(dialog);
}
}).request(new RequestCallback() {
@OverRide
public void onResult(boolean allGranted, List grantedList, List deniedList) {
if (allGranted) {
Toast.makeText(MainJavaActivity.this, "All permissions are granted", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(MainJavaActivity.this, "The following permissions are denied:" + deniedList, Toast.LENGTH_SHORT).show();
}
}
});
}
但是获取控件为空
View positiveButton = dialogFragment.getPositiveButton();
View negativeButton = dialogFragment.getNegativeButton();
请教郭神这种情况怎么处理比较好

升级到Android Studio 4.0, gradle版本为6.1.1时build失败。

错误信息:
Unable to load class 'org.gradle.api.internal.java.usagecontext.LazyConfigurationUsageContext'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

Android 7.1.2不走弹窗

image
如图:
默认第一次进来没有走去申请弹窗提示,拒绝禁止提示后也没有走去设置弹窗,并且首次进来会走request回调,allGranted为true
8.0及以上目前看是好的,郭神 帮看下
设备:vivo X9
系统:android 7.1.2

ACCESS_BACKGROUND_LOCATION 拒绝后不再提示

Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION
我申请这三个权限,点击拒绝不再提示,为什么request 的allGranted 是true呢,每次进入不应该走onForwardToSettings 强制设置权限么?我想实现即使用户点了拒绝不再提示,重新进app也得强制提示,我用的小米9手机

PermissionBuilder.grantedPermissions 空指针

发生机型:VIVO V1821A 与 OPPO R11
系统版本:Android 9(vivo),Android 8.1.0(oppo)

ava.lang.NullPointerException

Attempt to read from field 'java.util.Set com.permissionx.guolindev.request.PermissionBuilder.grantedPermissions' on a null object reference

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.