Skip to content Skip to sidebar Skip to footer

Android Proguard Enabled Apk Not Connecting To Azure Server

I have been looking a solution since last week. I have an application which is having a connection with windows azure server. I need to give my apk to clients so I am trying to enc

Solution 1:

I've hit the same problem myself, and after looking a little through the code, I found the solution: just rename 'mId' to 'id' and you are all good. MobileServiceClient.getTable() calls the validateClass() method which looks for a field named 'id' or if it's marked with the @SerializedName annotation, then the value of the annotation. Since it didn't find it by annotation value, just rename it in your code and it will pick it up by field name. It says that it must have only one id field, but the thing is, it doesn't find any, ergo the error.

Solution 2:

The annotations are accessed through reflection. ProGuard doesn't know about it, so you need to preserve them explicitly:

-keepattributes *Annotation*-keep @interface com.google.gson.annotations.SerializedName

Note that if you're using the standard Ant/Eclipse/Gradle build scripts, they already automatically specify all the necessary -injars, -outjars, and -libraryjars options, and other non-project-specific options.

Post a Comment for "Android Proguard Enabled Apk Not Connecting To Azure Server"