NetworkResponseAdapter icon indicating copy to clipboard operation
NetworkResponseAdapter copied to clipboard

Application crashing when minifyEnabled is set to true

Open Klewerro opened this issue 2 years ago • 5 comments

Probably caused by obfuscation. Currently in my rules I have mostly retrofit and okHttpt related rules, and my app crashing only when I'm trying to make http request. When I tried to comment http call useCase, everything works well. What should I put in proguard-rules.pro? Probably the same as this issue.

Klewerro avatar Apr 06 '23 15:04 Klewerro

Same here. @haroldadmin any idea? It's because of Proguard.

PavlosTze avatar Apr 21 '23 08:04 PavlosTze

@Klewerro Adding the following in proguard rules seems to fix the issue: -keep,allowobfuscation,allowshrinking interface com.haroldadmin.cnradapter.NetworkResponse

PavlosTze avatar Apr 21 '23 08:04 PavlosTze

I used -keep class com.haroldadmin.cnradapter.** { *; } just to keep everything

Klewerro avatar Apr 21 '23 09:04 Klewerro

-keep class com.haroldadmin.cnradapter.** { *; }

Thanks @Klewerro. I tried adjusting proguard for Retrofit, and in the end, it was this adapter release can't find

vurgunmert avatar Jul 24 '24 10:07 vurgunmert

Thanks all for the info.

This helped me, too.

If your app has multiple modules, try adding this to all the relevant modules and also the app module.

I would suggest adding this info to the README.md

ninovanhooff avatar Aug 15 '24 10:08 ninovanhooff