question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proguard causes `NoSuchMethodException`

See original GitHub issue

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).

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ultimate-deejcommented, Mar 3, 2016

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.

1reaction
eirinaioscommented, Mar 12, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proguard enabled NoSuchMethodException - android
I think the problem is with your model class used in RecyclerView adapter. · Kindly check, I posted Users model class · 1...
Read more >
ProGuard Manual: Troubleshooting - Guardsquare
If ProGuard is not keeping the right classes or class members, make sure you are using fully qualified class names. If the package...
Read more >
ProGuard Troubleshooting
If the package name of some class is missing, ProGuard won't match the elements that you might be expecting. It may help to...
Read more >
App crashed when generating apk with Proguard - Issue Tracker
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.NoSuchMethodException: <init> [class android.app.Application]
Read more >
<init> [class android.app.Activity, int] - Google Groups
Obfuscated build gives NoSuchMethodException: <init> [class android.app.Activity, int] ... I've got the recommended proguard config as shown below.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found