Karumi / Dexter

Android library that simplifies the process of requesting permissions at runtime.
http://karumi.com
Apache License 2.0
5.23k stars 671 forks source link

Not working with Dagger 2 #149

Closed daupawar closed 7 years ago

daupawar commented 7 years ago

Using MVP architecture with Dagger 2.

Expected behavior

Permission Dialog should show without declaring in the manifest file.

Actual behavior

Error message shows

com.karumi.dexter.DexterActivity}; have you declared this activity in your AndroidManifest.xml?

Steps to reproduce

Dexter.withActivity(this)
                .withPermissions(
                        Manifest.permission.ACCESS_FINE_LOCATION,
                        Manifest.permission.ACCESS_COARSE_LOCATION
                ).withListener(new MultiplePermissionsListener() {
            @Override
            public void onPermissionsChecked(MultiplePermissionsReport report) {
                Log.i("",report.toString());
            }

            @Override
            public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) {
                Log.i("",token.toString());
            }
        }).check();

inside onCreate of my Main Activity

Version of the library

Dexter version compile 'com.karumi:dexter:4.1.0'

Serchinastico commented 7 years ago

Hi @daupawar

DexterActivity is already declared in the Dexter Android Manifest so there is no reason for your code not to work. Are you using some sort of proguard/dexguard configuration? I guess the issue is related to that, we will be doing a release with a custom proguard configuration so that we don't obfuscate any class contained in the library.

Thanks for reporting

flipper83 commented 7 years ago

We don't have any reply about this problem for two months. I going to closed because we cannot reproduce the error without more info.