Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proguard causes NoSuchMethodException #4

Closed
landakram opened this issue Feb 6, 2015 · 5 comments
Closed

Proguard causes NoSuchMethodException #4

landakram opened this issue Feb 6, 2015 · 5 comments

Comments

@landakram
Copy link

Hey! Just want to say first that I really appreciate your work.

I'm using this library in an application and found a bug when using proguard. Without any changes to the proguard.project.txt file, I get this error when trying to use the animations:

W/System.err(22899): java.lang.NoSuchMethodException: <init> [float]
W/System.err(22899):    at java.lang.Class.getConstructorOrMethod(Class.java:472)
W/System.err(22899):    at java.lang.Class.getConstructor(Class.java:446)
W/System.err(22899):    at com.daimajia.easing.Skill.a(SourceFile:104)
W/System.err(22899):    at com.daimajia.easing.Glider.a(SourceFile:33)

I worked around this by adding to my proguard-project.txt file:

-keep class com.daimajia.easing.** { *; }
-keep interface com.daimajia.easing.** { *; }

It might be helpful to add this to documentation (like the README).

@daimajia
Copy link
Owner

Yeah, I'll do this today.

Thanks for your feedback. (SORRY FOR MY LATE REPLY). :-D

@landakram
Copy link
Author

Thanks @daimajia!

@ultimate-deej
Copy link

I've encountered exactly the same issue today.
The following rule helped me:

-keepclassmembers public class * extends com.daimajia.easing.BaseEasingMethod {
    public <init>(...);
}

The source of the problem is that constructors are called indirectly. This rule prevents proguard from removing constructors instead of forcing it to keep everything.

@eirinaios
Copy link

Thank you so much @ultimate-deej! You saved my day!

@nikkorejz
Copy link

Thanks, @ultimate-deej !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants