【问题标题】:Exception java.lang.NoClassDefFoundError: pim异常 java.lang.NoClassDefFoundError: pim
【发布时间】:2018-07-18 08:43:14
【问题描述】:

我在崩溃报告中遇到了这个崩溃:

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)

在我将 recyclelView 添加到我的布局和更多代码后开始发生这种情况,但我怀疑它:

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

这是我的自定义 recyclerview 但即使使用常规 recyclerview(不是我的自定义)也会发生此错误

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

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

}

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

无论如何,这个 MyRecyclerView 在我的 Activity 中作为成员持有:

我通过 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

【问题讨论】:

  • 面临同样的问题。无法识别来源。你也在使用 Youtube 视频吗?过去 2-3 天的崩溃次数有所增加。
  • 是的,我正在使用 YouTube 视频,并且在过去 2-3 天内崩溃的数量增加到数百个 :-\ 它主要发生在 API 19 上。如果我找到解决方案,我会在这里发布,所以请也这样做。您是否为您的应用上传了新版本?因为我做了,但后来我恢复了版本并且它继续发生。这太令人沮丧了:(
  • 这里也发生了。几天前开始(具体是月初),没有发布任何新的更新。除了应用程序中的多个 SDK 之外,我们也有 YouTube 视频,这使得很难识别来源。您是否使用任何广告网络?任何其他 SDK 都可能导致此问题?
  • 同样的问题,发生在 YouTube 播放器上。如果我将设备上的 youtube 播放器降级为出厂版本,视频播放正常,但升级最新版本后,它在我的应用程序上 50% 的时间随机崩溃。这已成为过去 2 天以来最严重的崩溃,从 2 月 1 日开始缓慢增加堆栈跟踪也是如此!
  • 这里也一样。 API 19 崩溃。Youtube 应用程序版本 13.04.55。重置为出厂版本 5.5.27 后,工作正常。

标签: java android firebase android-recyclerview firebase-crash-reporting


【解决方案1】:

所以我向谷歌报告了这个问题,现在他们回复说这个错误已经修复了! :-) 我想不需要更新库,因为没有可用的更新。此外,我还尝试使用 YouTube API 的 old 库,但遇到了同样的崩溃,因此与该库有关系。 Google 写信给我:“开发团队已修复您报告的问题,并将在未来的版本中提供。”

【讨论】:

  • 是的,我也得到了同样的反馈,已于 2 月 13 日完成。未来的构建时间表尚未更新,但会尝试获取更新并在此处发布。
  • 我猜他们可能会在 2 月底之前发布此修复程序。这很糟糕,但至少已修复
  • 我们是否必须在修复发生后发布新版本的应用程序,或者它只是反映在用户的设备中。
  • 这里也一样。本周有 32 个崩溃日志给实时用户,但无能为力。
  • 我 99.9% 确信我们不必发布修复程序,因为它是由 Google 构建的。我们只需要耐心等待。直到月底,它是固定的。令人讨厌的是,如果 youtube 用户遇到了这个错误,谷歌会立即发布该版本。至少它是固定的,所以我知道它对大公司的建设是如何运作的,你可以放心,这次崩溃将在本月消失
猜你喜欢
  • 1970-01-01
  • 2015-04-02
  • 1970-01-01
  • 1970-01-01
  • 2013-06-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-01
相关资源
最近更新 更多