Reputation: 912
I am using dexguard for obfuscation.I have implemented google contacts sync in my project.when i call the contact service class,this error is coming.i dint find the right solution for the error.i have gone through the mapping file also but i dint get any solution in mapping file. I have used many options like keep class and keepclassmembers.but still i get the same issue.
ContactsService contactsService = new ContactsService("MYAPPLICATION_NAME");
I got the erro when i call the above class.this is google contact service class.
below is the error log.
java.lang.IllegalArgumentException: Class class o.ڹ doesn't support metadata registration.
at o.ԁ.ˊ(:153)
at o.ԁ.ˊ(:121)
at o.ԁ.ˊ(:384)
at o.Ϋ.ˊ(:533)
at o.Ϋ.ˋ(:455)
at o.Ϋ.ˊ(:42)
at o.গ.ˋ(:144)
at o.ܪ.ˊ(:130)
at o.ᓷ.<init>(:536)
at o.ᓶ.<init>(:201)
at o.ᓶ.<init>(:174)
at o.ᓼ.<init>(:89)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.buzzboard.contacts.fragment.AddEditContactFragment.initContactsService(:1020)
at com.buzzboard.contacts.fragment.AddEditContactFragment.onCreateView(:244)
at android.support.v4.app.Fragment.performCreateView(:1786)
at android.support.v4.app.FragmentManagerImpl.moveToState(:947)
at android.support.v4.app.FragmentManagerImpl.moveToState(:1126)
at android.support.v4.app.BackStackRecord.run(:739)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(:1489)
at android.support.v4.app.FragmentManagerImpl$1.run(:454)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NoSuchMethodException: registerMetadata [class o.ԁ]
at java.lang.Class.getConstructorOrMethod(Class.java:472)
at java.lang.Class.getDeclaredMethod(Class.java:640)
at o.ԁ.ˊ(:139)
please help me.i have keep the some of google contact services classes also.
Upvotes: 0
Views: 907
Reputation: 45676
Looking at the source code and the documentation of com.google.gdata.model.MetadataRegistry, it seems some classes are expected to contain a static method 'registerMetadata', which is then accessed through reflection. Similarly, com.google.gdata.model.Element seems to expect a field 'KEY'. Since ProGuard or DexGuard can't know this, you need to preserve such fields and methods with their original names:
-keepclassmembers class * extends com.google.gdata.model.Element {
public static com.google.gdata.model.ElementKey KEY;
public static void registerMetadata(com.google.gdata.model.MetadataRegistry);
}
Upvotes: 2