Android Proguard Enabled Apk Not Connecting To Azure Server
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"