为什么存在具有类的NoClassDefFoundError?

时间:2017-06-08 12:53:27

标签: android kotlin noclassdeffounderror

我遇到了一个奇怪的NoClassDefFoundError,因为“NoClassDefFound的类”存在:

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)

但是类cn.dreamtobe.babyguard.b.a$e存在:

enter image description here

堆栈点:

Proguard one

enter image description here

来源

enter image description here

1 个答案:

答案 0 :(得分:1)

java.util.ArrayList#removeIf方法被添加到Java 8中的ArrayList,以及功能接口(例如Predicate)。您可以使用Kotlin instaed的filterNot