Android Volley Proguard Throws Java.lang.runtimeexception: Stub
I'm using Android Volley network library which when kept in debugging + release modes works perfectly fine, until I added Twilio client SDK. Now it works fine when in debugging mod
Solution 1:
I'm posting my solution in case if someone finds it useful someday.
The cause of "stub!"
This happens when using Proguard and the com.apache.http.legacy library in Android SDK 23.
As a matter of fact, all the methods are stubbed out to throw an exception with the message “Stub!” when you call them. How cute.
The real android.jar implementations live on the emulator, or your real Android device.
So changing the proguard rules solved the following, seems like twilio is using old http library or something not sure.
So, here's my current solution
# Twilio Client
-keep class com.twilio.** { *; }
-keep class org.webrtc.** { *; }-keep class com.twilio.video.** { *; }-keepattributes InnerClasses-keep class org.apache.http.** { *; }-keep class org.apache.commons.codec.** { *; }-keep class org.apache.commons.logging.** { *; }-keep class android.net.compatibility.** { *; }-keep class android.net.http.** { *; }-keep class com.android.internal.http.multipart.** { *; }-dontwarn org.apache.http.**-dontwarn android.webkit.**-keepattributes EnclosingMethod
Source Link to SO answer
Post a Comment for "Android Volley Proguard Throws Java.lang.runtimeexception: Stub"