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

proguard? #150

Closed star-andy closed 7 years ago

star-andy commented 7 years ago

Expected behaviour

image Whether to need to configure the proguard

Actual behaviour

Steps to reproduce

Version of the library

com.karumi:dexter:4.0.0

Serchinastico commented 7 years ago

Hi @qinyang1018,

First of all, thanks for reporting! I'm reading the source code and this is the offending line where the NPE is happening:

void onActivityDestroyed() {
    isRequestingPermission.set(false);
}

I can't see how that line can fail (isRequestingPermission is initialized in the constructor and never null'ed) How are you running Dexter? Have you tried updating to the latest release (4.1.0)?

star-andy commented 7 years ago

image this is all server log

Thank you for your answer I will try to 4.1.0 and

void onActivityDestroyed() {
    isRequestingPermission.set(false);
}
Serchinastico commented 7 years ago

We are going to release a new version of Dexter with a proguard configuration so that we don't obfuscate any class in Dexter and we can debug what's happening better.

Thanks for reporting!

star-andy commented 7 years ago

ok thank you

star-andy commented 7 years ago

ok i will try wait new version thank you

pedrovgs commented 7 years ago

@flipper83 @Serchinastico I've seen you've merged a PR adding proguard support but not exporting the proguard configuration with the aar generated during the release.

You should enable consumerProguardFiles param as part of your build configuration.

Here you have an example:

defaultConfig {
    ...
    consumerProguardFiles 'proguard-rules.pro'
  }
Serchinastico commented 7 years ago

Thank you @pedrovgs!

I checked the configuration with the project Demo and didn't really used the generated AAR, I'm including the property just now before doing a release.

Cheers!

EmmettWilson commented 7 years ago

As far as the original exception. This appears to me to be a duplicate of https://github.com/Karumi/Dexter/issues/153?