What does this mean “No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp”?

后端 未结 1 666
自闭症患者
自闭症患者 2021-01-18 12:49

I am trying to parse local url (http://192.168.1.94/wamp/up.php) to use it in my app android ( JSON parse ).

mainActivity android :

    package itawf         


        
相关标签:
1条回答
  • 2021-01-18 13:26

    I am not sure it will solve your problem, but in many cases there is a permission request problem in API 23 or above.

    I also faced the same problem in my project, which I resolved by using bellow procedure.

    To avoid No DRP key due to exception:java.lang.ClassNotFoundException request permission in Splash screen in above API 23

    Eg:

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        permission = Settings.System.canWrite(this);
    } else {
        permission = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_SETTINGS) == PackageManager.PERMISSION_GRANTED;
    }
    if (!permission) {
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
            Intent intent = new Intent(Settings.ACTION_MANAGE_WRITE_SETTINGS);
            intent.setData(Uri.parse("package:" + getPackageName()));
            startActivityForResult(intent, CODE_WRITE_SETTINGS_PERMISSION);
    
        }
    }
    

    after checking the above permission, check the remaining permissions in onActivityResult, one by one.

    e.g,

    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
    
        Log.v("Permission", Manifest.permission.WRITE_EXTERNAL_STORAGE+"  Permission is revoked");
        ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, CODE_WRITE_SETTINGS_PERMISSION);
    
        return;
    }
    
    0 讨论(0)
提交回复
热议问题