Google Places show Error while using proguard

364 Views Asked by At

After migrating to new google place library in android every thing is working fine as expected without proguard. But while enabling the proguard I got the following error

com.google.android.libraries.places.internal.hg: can't find referenced class com.google.j2objc.annotations.RetainedWith

In gradle for google places I used

implementation 'com.google.android.libraries.places:places:1.1.0'

For Similar question Some one has added the following to resolve the issue but for me its still not working

-keepnames class * implements java.io.Serializable

-keepclassmembers class * implements java.io.Serializable {
 static final long serialVersionUID;
 private static final java.io.ObjectStreamField[] serialPersistentFields;
 !static !transient <fields>;
 !private <fields>;
 !private <methods>;
 private void writeObject(java.io.ObjectOutputStream);
 private void readObject(java.io.ObjectInputStream);
 java.lang.Object writeReplace();
 java.lang.Object readResolve();
 }

But still same error. How can I fix it.

2

There are 2 best solutions below

0
keepTrackOfYourStack On

Kind of a stab in the dark, but I would try this:

-keep public class com.google.j2objc.** { public *; }
-dontwarn com.google.j2objc.**
0
Abdulfattah Hassan Abdullahi On

use google places version 1.0.0 instead of 1.1.0