android-PlacesAutocompleteTextView icon indicating copy to clipboard operation
android-PlacesAutocompleteTextView copied to clipboard

Proguard rule needed

Open erikswed opened this issue 7 years ago • 6 comments

I´m building a release build but cannot get past his proguard related error:

Process: com.toy.android.production, PID: 13817
java.lang.NullPointerException: Attempt to read from field 'java.lang.Object android.widget.Filter$FilterResults.values' on a null object reference
   at com.seatgeek.placesautocomplete.adapter.PlacesApiFilter.publishResults(SourceFile:120)
   at android.widget.Filter$ResultsHandler.handleMessage(Filter.java:282)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:158)
   at android.app.ActivityThread.main(ActivityThread.java:7225)
   at java.lang.reflect.Method.invoke(Native Method)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

In my proguard-rules.pro file I have the:

-keep class com.seatgeek{ *; } -keep public class com.toy.android.ui.adapter.PlacesAutocompleteAdapter{ *; }

What am I missing please advice

erikswed avatar Jan 27 '17 21:01 erikswed

I worked it out to this:

-keep class com.seatgeek.**{ ; } -keep public interface com.seatgeek.placesautocomplete.history.AutocompleteHistoryManager{;}

Don´t know why I have to explicita keep this interface but it took two days to find the it

erikswed avatar Jan 28 '17 18:01 erikswed

Going to reopen this, I think it'd be a good idea for us to package proguard rules in our AAR

sddamico avatar Jan 30 '17 15:01 sddamico

thanks great

erikswed avatar Jan 31 '17 18:01 erikswed

@sddamico I am pretty sure that just

-dontwarn com.squareup.okhttp.**

should be enough. See here for reference

anas-ambri avatar Jan 10 '18 20:01 anas-ambri

I am using this library but after enable proguard my application force close android.view.InflateException: Binary XML file line #65: Binary XML file line #65: Error inflating class com.seatgeek.placesautocomplete.PlacesAutocompleteTextView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.access$1100(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7325) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: android.view.InflateException: Binary XML file line #65: Binary XML file line #65: Error inflating class com.seatgeek.placesautocomplete.PlacesAutocompleteTextView

and i m already use -keep class com.seatgeek.**{ ; } -keep public interface com.seatgeek.placesautocomplete.history.AutocompleteHistoryManage -keep public class com.toy.android.ui.adapter.PlacesAutocompleteAdapter{ *; }

Please give some solution much needed Thanks in advance.

singhmeenu avatar Jul 27 '18 17:07 singhmeenu

keeping com.seatgeek.** is generally overly broad, should narrow it down to:

-keep class com.seatgeek.placesautocomplete.model.** { *; } for json mapping

sddamico avatar Jun 01 '21 16:06 sddamico