Scarlet icon indicating copy to clipboard operation
Scarlet copied to clipboard

Proguard rules?

Open SergiyKorotun opened this issue 6 years ago • 4 comments

I tried to use scarlet (0.16 and 0.17) and I having an issue when proguard is enabled. Are there any specific rules for that?

SergiyKorotun avatar Feb 13 '19 13:02 SergiyKorotun

i dont remember we have a specific proguard rules. can you post the errors?

aaronweihe avatar Feb 20 '19 22:02 aaronweihe

I got proguard error :

`Note: there were 9 references to unknown classes. You should check your configuration for typos. (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass) Note: there were 2 references to unknown class members. You should check your configuration for typos. Note: there were 221 unkept descriptor classes in kept class members. You should consider explicitly keeping the mentioned classes (using '-keep'). (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass) Note: there were 49 unresolved dynamic references to classes or interfaces. You should check if you need to specify additional program jars. (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass) Warning: there were 111 unresolved references to classes or interfaces. You may need to add missing library jars or update their versions. If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options. (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass) Warning: there were 5 instances of library classes depending on program classes. You must avoid such dependencies, since the program classes will be processed, while the library classes will remain unchanged. (http://proguard.sourceforge.net/manual/troubleshooting.html#dependency) Warning: there were 3 unresolved references to program class members. Your input classes appear to be inconsistent. You may need to recompile the code. (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedprogramclassmember) Warning: Exception while processing task java.io.IOException: Please correct the above warnings first. Thread(Tasks limiter_1): destruction

Task :app:transformClassesAndResourcesWithProguardForRelease FAILED ` If I remove Scarlet from dependencies list everything is OK

SergiyKorotun avatar Feb 21 '19 08:02 SergiyKorotun

The problem was in com.github.tinder.scarlet:scarlet-lifecycle-android module this module included all third-party libs from scarlet (Jackson, Moshi , Rxjava1, RxJava 2 etc) image

the solution is to exclude scarlet module from scarlet:scarlet-lifecycle-android

implementation ("com.github.tinder.scarlet:scarlet-lifecycle-android:$scarlet_version"){ exclude group: 'com.github.tinder', module: 'scarlet' }

Hope it will be useful

SergiyKorotun avatar Feb 28 '19 11:02 SergiyKorotun

I had this same issue and took me quite some time to figure out it was an issue with Scarlet, it'd be great if the configuration shared by @SergiyKorotun can be added to the README to help future devs.

francos avatar Apr 15 '19 07:04 francos