optimizely/android-sdk

Proguard fails on latest version of sdk

matt-harris-mc opened this issue · 17 comments

Running the latest version (3.0) of the sdk fails when proguard is enabled with the below:

Warning: com.optimizely.ab.config.parser.JacksonConfigParser$ProjectConfigModule: can't find referenced method 'com.fasterxml.jackson.databind.module.SimpleModule addDeserializer(java.lang.Class,com.fasterxml.jackson.databind.JsonDeserializer)' in program class com.optimizely.ab.config.parser.JacksonConfigParser$ProjectConfigModule

Thanks for reporting @matt-harris-mc . We are looking into this.

hi @matt-harris-mc what proguard rules are you using?

We have a set of rules locally that we use for other stuff, but I was under the impression any required rules are automatically included in the aar. Are you worried that we possibly have rules that conflict with those?

@matt-harris-mc can you try the following:
can you add the following to your proguard rules?

-keep class com.fasterxml.jackson.** {*;}

@thomaszurkan-optimizely I added that line to my proguard file and it is still failing with the same message. Also reverted to 2.1.4 to confirm my build is still working and it is not something else local to me.

so, 2.1.4 works and 3.0 doesn't?

Yep 2.1.4 is building without issue.

compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'

are you compiling in jackson-databind?

We are not using it directly or even indirectly. It looks like the only reference to jackson we have is in a progaurd section we have included (commented as for firebase): -keepnames class com.fasterxml.jackson.** { *; }

hmm, if you add the jackson-databind in there i would assume it would work. we are looking into a solution. thanks!

Yea it looks like adding that lib as a dependency does fix the issue. Going to hold on 2.1.4 for now though. Thanks for the quick responses.

could you try not compiling without jackson databind and instead add -dontwarn com.fasterxml.jackson.databind.**? to see if that works

@thomaszurkan-optimizely Are you saying to leave out jackson-databind and add the proguard rule? Gave that a try and it still fails.

Hi guys,
Any new information about this? We are facing the same issue with the 3.0.0 SDK.

Edit: Adding compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8' worked for me.

Also running into this issue. Using a -dontwarn com.optimizely.ab.config.parser.JacksonConfigParser$ProjectConfigModule until this gets fixed.

@matt-harris-mc compile 'com.optimizely.ab:android-sdk:3.0.1'
Sorry it took so long. We fixed the other issues as well. Thanks.