Exception java.lang.NoClassDefFoundError: pim

我在崩溃报告中遇到此崩溃:

Exception java.lang.NoClassDefFoundError: pim
pil.<clinit> (SourceFile:2)
pij.onAnimationEnd (SourceFile:10)
android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd     (AnimatorSet.java:818)
android.animation.ValueAnimator.endAnimation (ValueAnimator.java:1056)
android.animation.ValueAnimator.access$400 (ValueAnimator.java:50)
android.animation.ValueAnimator$AnimationHandler.doAnimationFrame     (ValueAnimator.java:644)
android.animation.ValueAnimator$AnimationHandler.run (ValueAnimator.java:660)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:761)
android.view.Choreographer.doCallbacks (Choreographer.java:574)
android.view.Choreographer.doFrame (Choreographer.java:543)
android.view.Choreographer$FrameDisplayEventReceiver.run     (Choreographer.java:747)
android.os.Handler.handleCallback (Handler.java:733)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:136)
android.app.ActivityThread.main (ActivityThread.java:5154)
java.lang.reflect.Method.invokeNative (Method.java)
java.lang.reflect.Method.invoke (Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run     (ZygoteInit.java:732)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:566)
dalvik.system.NativeStart.main (NativeStart.java)

在我向布局和更多代码添加recyclview后,它开始发生,但我怀疑它:

com.testapp.MyRecyclerView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/recycleViewImages"

这是我的自定义回收器视图,但即使使用常规回收器视图(不是我的自定义),也会发生此错误

这是我的自定义视图的代码:

public class MyRecyclerView extends RecyclerView {
private FirebaseAnalytics mFirebaseAnalytics = null;

public MyRecyclerView(Context context) {
    super(context);
    if (mFirebaseAnalytics == null && context != null) {
        mFirebaseAnalytics = FirebaseAnalytics.getInstance(context);
    }
}

public MyRecyclerView(Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
    if (mFirebaseAnalytics == null && context != null) {
        mFirebaseAnalytics = FirebaseAnalytics.getInstance(context);
    }
}

public MyRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    if (mFirebaseAnalytics == null && context != null) {
        mFirebaseAnalytics = FirebaseAnalytics.getInstance(context);
    }
}


@Override
protected void onAnimationEnd() {
    try {
        super.onAnimationEnd();
    }
    catch (Exception e) {
        Log.d("erez", "animation onAnimationEnd");
        if (mFirebaseAnalytics != null && e != null && e.getMessage() != null) {
            Bundle bundleCatch = new Bundle();
            bundleCatch.putString(FirebaseAnalytics.Param.ITEM_ID, "myrecycleview e: " + e.getMessage());
            bundleCatch.putString(FirebaseAnalytics.Param.ITEM_NAME, "myrecycleview e: " + e.getMessage());
            bundleCatch.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "onAnimationEnd catched");

        mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundleCatch);
        }
    }
    catch (NoClassDefFoundError ncdfe) {
        if (mFirebaseAnalytics != null && ncdfe != null && ncdfe.getMessage() != null) {
            Bundle bundleCatch = new Bundle();
            bundleCatch.putString(FirebaseAnalytics.Param.ITEM_ID, "myrecycleview ncdfe: " + ncdfe.getMessage());
            bundleCatch.putString(FirebaseAnalytics.Param.ITEM_NAME, "myrecycleview ncdfe: " + ncdfe.getMessage());
            bundleCatch.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "onAnimationEnd catched");
          mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundleCatch);
        }
    }
}

}

如您所见,我正在尝试在AnimationEnd上覆盖,以便将捕获日志写入firebase,但它没有被捕获并且仍然对用户崩溃。

无论如何,这个MyRecyclerView是我活动中的成员:

我通过findViewById设置它,然后:

LinearLayoutManager layoutManager = new LinearLayoutManager(Player.this);
    if (mScreenOrientation == Configuration.ORIENTATION_PORTRAIT) {
        layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
    } else if (mScreenOrientation == Configuration.ORIENTATION_LANDSCAPE) {
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    }
    mRecycleViewPreviewedVideos.setLayoutManager(layoutManager);

然后我设置其适配器,如用户在此处看到的那样。没什么特别的。我知道View有一个名为onAnimationEnd的方法,但它从未在我的智能手机中到达过它。它主要只在Api 19上达到。(以及17和18)。

有人曾经有过这种崩溃吗?如何解决?

更新

我在这里报告了这个错误:https://issuetracker.google.com/issues/73048586


答案 1

所以我向谷歌报告了这个问题,现在他们回应说这个错误已经修复了!:-)我猜不需要库更新,因为没有可用的更新。此外,我还尝试使用旧的YouTube API库,但与库的关系相同,因此מם关系。谷歌给我写信说:“开发团队已经解决了你报告的问题,它将在将来的版本中可用。


答案 2

推荐