Jacks Gong
Jacks Gong

Reputation: 694

Why there is NoClassDefFoundError with a class that exists?

I experience a weird NoClassDefFoundError, because the "NoClassDefFound's class" exists:

enter image description here

Fatal Exception: java.lang.NoClassDefFoundError: cn.dreamtobe.babyguard.b.a$e
       at cn.dreamtobe.babyguard.data.BabyGuardDatabase.repealLastAction(BabyGuardDatabase.kt:109)
       at cn.dreamtobe.babyguard.data.BabyGuardDatabase$show$1.onClick(BabyGuardDatabase.kt:192)
       at android.support.design.widget.Snackbar$1.onClick(Snackbar.java:255)
       at android.view.View.performClick(View.java:5207)
       at android.view.View.onKeyUp(View.java:9893)
       at android.widget.TextView.onKeyUp(TextView.java:6201)
       at android.view.KeyEvent.dispatch(KeyEvent.java:2667)
       at android.view.View.dispatchKeyEvent(View.java:9245)

But the class cn.dreamtobe.babyguard.b.a$e is exists:

enter image description here

Stack point:

Proguard one

enter image description here

Source one

enter image description here

Upvotes: 0

Views: 555

Answers (1)

Miha_x64
Miha_x64

Reputation: 6363

java.util.ArrayList#removeIf method was added to ArrayList in Java 8, along with functional interfaces (e. g. Predicate). You can use filterNot from Kotlin instead.

Upvotes: 2

Related Questions