我在坠机报告中看到这起坠机事件:
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"这是我的自定义回收视图,但是这个错误发生在常规的回收视图中(不是我的习惯)。
这是我的定制视图的代码:
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,以便将捕获日志写到防火墙中,但是它没有被捕获,并且仍然对用户造成崩溃。
无论如何,这个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)。
,有谁有过这次坠机吗?如何修复?
更新
我在这里报告了这个bug:https://issuetracker.google.com/issues/73048586
发布于 2018-02-13 12:27:06
因此,我向Google报告了这个问题,现在他们回答说,bug已经修复了!:-)我想不需要任何库更新,因为没有更新。此外,我还尝试使用旧库的YouTube API,但得到了同样的崩溃,因此מם与库的关系。谷歌()给我写信说:“开发团队已经解决了你报告的问题,它将在将来的构建中使用。”
https://stackoverflow.com/questions/48674311
复制相似问题