18

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

Maor Cohen
  • 878
  • 2
  • 14
  • 30
  • 2
    Facing same issue. Not able to identify the source. Are you using Youtube videos as well? The number of crashes increased in the last 2-3 days. – Karthik Feb 08 '18 at 11:12
  • 2
    yes, I'm using YouTube videos and the number of crashes was increased in the last 2-3 days to hundreds :-\ It occurs on API 19 mostly. If I find a solution, I'll post it here so do the same please. Did you upload a new version for your app? Because I did but then I revert the version and it keeps on happening. it's so frustrating :( – Maor Cohen Feb 08 '18 at 11:34
  • 1
    Happening here as well. Started a few days ago (beginning of month to be specific) without releasing any new updates. We have YouTube videos too, in addition to multiple SDKs in the app, which makes it hard to identify the source. Are you using any Ad networks? any other SDKs could be causing this? – Andrew Aziz Feb 08 '18 at 11:45
  • wow :\ no special sdk except Picasso. Do you use it? and I'm using Admob only. you? – Maor Cohen Feb 08 '18 at 11:51
  • And do you get the same error exactly? Exception java.lang.NoClassDefFoundError: pim pil. (SourceFile:2) pij.onAnimationEnd (SourceFile:10) – Maor Cohen Feb 08 '18 at 11:55
  • i have the same problem – Praveen Feb 08 '18 at 11:57
  • but give details. When did it start? any version update? api version? – Maor Cohen Feb 08 '18 at 11:59
  • youtube video integration – Praveen Feb 08 '18 at 12:03
  • Using Picasso and Admob as well. Disabled Admob remotely, and it still happens. Yes, the exception is the same (pij.onAnimationEnd). Not sure if it's YouTube, as it happens on a version of the app without YouTube videos at all. Very frustrating. It happens on Android 4 only. – Andrew Aziz Feb 08 '18 at 12:11
  • On the device, if I downgrade Youtube app, then crash doesnt happen. Looks like due to recent Youtube app update released. – Karthik Feb 08 '18 at 12:13
  • @AndrewAziz Did you have any video ads when crash happened? – Karthik Feb 08 '18 at 12:15
  • 1
    Same issue, happens with YouTube player. If I downgrade the youtube player to factory version on the device, the video plays fine, but with latest version upgraded, it crashes randomly 50% of the time on my app. This has become the top crash from last 2 days, was slowly increasing from 1 Feb Also the stack trace is ditto ! – Amit Feb 08 '18 at 12:18
  • Karthik is correct. It's the latest YouTube update causing this. – Andrew Aziz Feb 08 '18 at 12:21
  • What is the factory version? And why not downgrading if it can solve the issue? I'm using this version: 'com.google.apis:google-api-services-youtube:v3-rev187-1.23.0' – Maor Cohen Feb 08 '18 at 12:45
  • @Amit Amit, so do you have android 4? how can I downgrade the youtube player to the fractory version? please let me know.. – Maor Cohen Feb 08 '18 at 12:48
  • Not youtube player. Youtube App on the device. Open app info of 'Youtube', Click 'Uninstall to factory'. – Karthik Feb 08 '18 at 12:50
  • Lets wait for a fix from Google for this. – Karthik Feb 08 '18 at 12:50
  • @Erez Right, it is not youtube player, but youtube app which powers the player as well. – Amit Feb 08 '18 at 13:11
  • and when does this bug happen? when you play a video or before(when you are directed to the activity that hold the youtubeplayer)? – Maor Cohen Feb 08 '18 at 14:05
  • @Amit Can you please try to upgrade your youtube dependency to this one and tell me if it keeps on happening? compile('com.google.apis:google-api-services-youtube:v3-rev192-1.23.0') – Maor Cohen Feb 08 '18 at 14:32
  • update: I reported the issue here: https://issuetracker.google.com/issues/73048586 – Maor Cohen Feb 08 '18 at 14:49
  • Reported it to a google internal and he is raising with Youtube team as well – Amit Feb 08 '18 at 17:36
  • @Amit great.. and does the crash happen to you with the last library of youtube? Can you please try? compile('com.google.apis:google-api-services-youtube:v3-rev192-1.23.0') – Maor Cohen Feb 08 '18 at 17:46
  • 1
    Same here. Crashing on API 19. Youtube app version 13.04.55. After reseting to factory version 5.5.27, works fine. – Zhanbolat Raimbekov Feb 10 '18 at 03:11
  • Seems youtube team has fixed this , seeing crashes go down considerably – Amit Mar 03 '18 at 12:22

1 Answers1

2

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

Maor Cohen
  • 878
  • 2
  • 14
  • 30
  • Yes, I too got the same feedback, was done on 13th Feb. Future build timelines not updated yet though, will try to get that update and post here too. – Amit Feb 14 '18 at 05:46
  • They may release this fix until the end of February as I guess.. it's bad but at least it's fixed – Maor Cohen Feb 15 '18 at 11:10
  • Do we have to release a new version of the app after the fix happens or it is just reflected in users's devices. – Swapnil Feb 16 '18 at 05:11
  • Same here. 32 crash logs this week to live users and can't do anything. – Khawar Raza Feb 16 '18 at 09:38
  • I'm 99.9% sure that we won't have to release a fix because it's a build of Google. We just need to be patient. until the end of the month and it's fixed. It's annoying that if the youtube users had experienced this bug, google would release the build immediately. At least it's fixed so I know how it works about big companies builds, you can be calm that this crash will be gone this month – Maor Cohen Feb 16 '18 at 12:13
  • I am getting another similar crash that says `java.lang.NoClassDefFoundError: ppn` This I noticed is caused as soon my fragment hosting a youtubeview is loaded. As soon as it is loaded, I get a callback on `onStopped()` method of the `PlaybackEventListener` and the app crashes after that with more of less similar trace as mentioned in the question. – Swapnil Feb 16 '18 at 13:31
  • Good to know it is going to be fixed by end of this month... @Swapnil yea getting same now too java.lang.NoClassDefFoundError: ppn at ppm.(SourceFile:2) – Zaki Feb 17 '18 at 21:55
  • @Swapnil me too.. ppn and pim but ppn occurs less times – Maor Cohen Feb 18 '18 at 22:58
  • @Swapnil yes, ppm, pil and prf in my case - all with similar logs. and we have 100Ks of crashes and affecting our rating :( So waiting – Amit Feb 19 '18 at 06:08
  • yes, they are killing the app! it's so annoying! I really hope that after the fix it will be back to live :\ – Maor Cohen Feb 19 '18 at 08:17
  • I have the same problem anything new with the solution ?? – Biro Nader Feb 21 '18 at 17:22
  • The YouTube player API is known for not being reliable on Android, to overcome its issues I've built an open source player. It is stable and allows for more customization than the original API. You can check it out here https://github.com/PierfrancescoSoffritti/Android-YouTube-Player – Pierfrancesco Soffritti Feb 24 '18 at 16:26
  • Seems to be fixed, I am seeing the crashes go down considerably in the last 2-3 days – Amit Mar 03 '18 at 12:21