Android ProguardRules for CouchbaseLite v2.1.0

Dear Experts,

I am using CouchbaseLite version - 2.1.0. I have added the below Proguard Rules:

-keep class com.couchbase.litecore.**{ *; }
-keep class com.couchbase.lite.**{ *; }
-keep public class com.couchbase.lite.** { *; }
-dontwarn com.couchbase.lite.**
-keep public class com.fasterxml.jackson.** { *; }
-dontwarn com.fasterxml.jackson.**

But, getting Lint error - “Unresolved Class Name”. Anyone please help me with correct ProGuard configuration for CBL 2.1.0.

Nothing in that error message points to Couchbase Lite. Please share full error. Maybe its a dependency.

@blake.meike can confirm but something like this should work

-keep class com.couchbase.lite.* { *; }
-keep class com.couchbase.lite.**.* { *; }

Thanks Priya for quick response.

Please find the attached screenshot showing Lint error .

Please help me to resolve this issue.

The lint errors appear because the rules you’ve built don’t make sense. There is, for instance, no package named com.couchbase.litecore (as the error message states). The second rule is also syntactically incorrect.

The rules that @priya.rajagopal cites might work… but they are quite unnecessarily broad, preventing the optimization of the entire Couchbase Lite library. It would be better, I think, to follow the recommendations in our documentation, here:

Your rules here are just as broad.

Thanks for catching that error in the README. The rules that I cited, the correct ones, are not as broad. I’ll correct the README.

1 Like