Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception java.lang.NoClassDefFoundError: pim

I get this crash in Crash Reporting:

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)

It started happening after I added recyclelView to my layout and more code but I suspect it:

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

this is my custom recyclerview but this bug happened even with the regular recyclerview (not my custom)

and here is the code of my customview:

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);
        }
    }
}

}

As you see, I'm trying to override onAnimationEnd in order to write the catch log to firebase but it isn't caught there and still crashing for the users.

Anyway, this MyRecyclerView is held as a member in my Activity:

I set it by findViewById and then:

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

and then I set its adapter as seen by users here. nothing special. I know that View has a method named onAnimationEnd but it never reaches it in my smartphone. it's only reached on Api 19 mostly. (and also 17 and 18).

Anyone got this crash ever? how to fix it?

UPDATE

I reported the bug here: https://issuetracker.google.com/issues/73048586

like image 232
Maor Cohen Avatar asked Feb 07 '18 22:02

Maor Cohen


1 Answers

So I reported the issue to Google and now they responded that the bug is fixed! :-) I guess that no library update is needed as no update is available. Moreover, I also tried to use an old library of YouTube API but got the same crash so מם relation to the library. Google wrote me: "The development team has fixed the issue that you have reported and it will be available in a future build."

like image 68
Maor Cohen Avatar answered Nov 03 '22 13:11

Maor Cohen