Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proguard fails on latest version of sdk #258

Closed
matt-harris-mc opened this issue Mar 1, 2019 · 17 comments
Closed

Proguard fails on latest version of sdk #258

matt-harris-mc opened this issue Mar 1, 2019 · 17 comments

Comments

@matt-harris-mc
Copy link

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

@aliabbasrizvi
Copy link
Contributor

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

@thomaszurkan-optimizely
Copy link
Contributor

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

@matt-harris-mc
Copy link
Author

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?

@thomaszurkan-optimizely
Copy link
Contributor

thomaszurkan-optimizely commented Mar 1, 2019

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

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

@matt-harris-mc
Copy link
Author

@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.

@thomaszurkan-optimizely
Copy link
Contributor

so, 2.1.4 works and 3.0 doesn't?

@matt-harris-mc
Copy link
Author

Yep 2.1.4 is building without issue.

@thomaszurkan-optimizely
Copy link
Contributor

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

are you compiling in jackson-databind?

@matt-harris-mc
Copy link
Author

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.** { *; }

@thomaszurkan-optimizely
Copy link
Contributor

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

@matt-harris-mc
Copy link
Author

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.

@thomaszurkan-optimizely
Copy link
Contributor

thomaszurkan-optimizely commented Mar 1, 2019

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

@matt-harris-mc
Copy link
Author

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

@PhilippNowak96
Copy link

PhilippNowak96 commented Apr 3, 2019

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.

@kempermr
Copy link

kempermr commented Apr 3, 2019

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

@thomaszurkan-optimizely
Copy link
Contributor

@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.

@thomaszurkan-optimizely
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants