Evilripper
Evilripper

Reputation: 1185

Missing class: okhttp3.internal.http.UnrepeatableRequestBody

I updated Android Studio to 3.5 and now I have problem with

minifyEnabled true

When I try send json data with okhttp3, the body is null.

I tried to add these rules to proguard, but the problem remains.

-keep class cn.pedant.SweetAlert.** { *; }
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }

I see only this warning when minifyEnabled is true and only when I change the version. :-| enter image description here

Any ideas?

For the moment I set minifyEnabled to false. -_-

Upvotes: 1

Views: 882

Answers (1)

ricardopereira
ricardopereira

Reputation: 11683

The UnrepeatableRequestBody has been removed in v3.14 with this PR: https://github.com/square/okhttp/pull/4676.

So, I ended up ignoring the warning by adding:

-dontwarn okhttp3.internal.http.UnrepeatableRequestBody

Now, why it's warning us about that missing interface? Well, I guess it's because one of the okhttp3 internal libraries relied on UnrepeatableRequestBody which got removed and it's probably a temporary warning that will be fixed when the internal library gets updated with the RequestBody#isOneShot new feature.

Upvotes: 2

Related Questions