consp1racy / android-support-preference

Android Preferences according to Material design specs
Apache License 2.0
331 stars 49 forks source link

Version 1.2.3 crashes Proguard build #59

Closed rubengees closed 7 years ago

rubengees commented 7 years ago

Library 1.2.3 AppCompat 25.1.0

I just updated to version 1.2.3 and this sadly crashes Proguard and NewClassShrinker builds. The error is:

Warning:net.xpece.android.support.preference.ListPreference: can't find referenced method 
'void setEpicenterBounds(android.graphics.Rect)'
in program class net.xpece.android.support.widget.XpListPopupWindow

Thanks in advance for having a look.

corwin42 commented 7 years ago

I think this is related. When you create a ListPreference with simple menu mode then clicking on the preference item results in the following error:


java.lang.NoSuchMethodError: net.xpece.android.support.widget.XpListPopupWindow.setEpicenterBounds
    at net.xpece.android.support.preference.ListPreference.showAsPopup(ListPreference.java:204)
    at net.xpece.android.support.preference.ListPreference.performClick(ListPreference.java:140)
    at android.support.v7.preference.Preference$1.onClick(Preference.java:149)
    at android.view.View.performClick(View.java:4084)
    at android.view.View$PerformClick.run(View.java:16966)
    at android.os.Handler.handleCallback(Handler.java:615)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4745)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
consp1racy commented 7 years ago

Thanks, I'll deal with it right away.

consp1racy commented 7 years ago

Make sure you have support-spinner:1.2.3 as well as support-preference.

corwin42 commented 7 years ago

Ahh, that did the trick. I was still using 1.0.4. With support-spinner:1.2.3 everything is fine.

Thanks very much

consp1racy commented 7 years ago

Ok, just pushed 1.2.4 out. The app will not crash anymore with older support-spinner, but proguard will still complain unless you get support-spinner 1.2.4 as well. Will fix that in the future.

rubengees commented 7 years ago

Thank you for the fast response! Works perfectly when also specifying support-spinner. Automatic transitive resolution would be great so we would not have to maintain an additional dependency.

consp1racy commented 7 years ago

There is a transitive dependency of support-preference v1.x.x on the latest support-spinner 1.x.x. I'll have to check this out.

This was my mistake, I made a breaking API change in support-spinner and didn't account for it in support-preference.

consp1racy commented 7 years ago

support-preference v1.2.5 should work out of the box.