0

I saw this exception in Firebase Crash Report. but i didnt know why its happened. and it is happened just in android 4.4. does any one know why I got this exception?

Exception java.lang.NullPointerException:
    android.view.HardwareRenderer$GlRenderer.checkRenderContextUnsafe (HardwareRenderer.java:1791)
    android.view.HardwareRenderer$GlRenderer.draw (HardwareRenderer.java:1474)
    android.view.ViewRootImpl.draw (ViewRootImpl.java:2839)
    android.view.ViewRootImpl.performDraw (ViewRootImpl.java:2705)
    android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2274)
    android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1311)
    android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:6711)
    android.view.Choreographer$CallbackRecord.run (Choreographer.java:813)
    android.view.Choreographer.doCallbacks (Choreographer.java:613)
    android.view.Choreographer.doFrame (Choreographer.java:583)
    android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:799)
    android.os.Handler.handleCallback (Handler.java:733)
    android.os.Handler.dispatchMessage (Handler.java:95)
    android.os.Looper.loop (Looper.java:146)
    android.app.ActivityThread.main (ActivityThread.java:5756)
    java.lang.reflect.Method.invokeNative (Method.java)
    java.lang.reflect.Method.invoke (Method.java:515)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1291)
    com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1107)
    dalvik.system.NativeStart.main (NativeStart.java)
Tim
  • 41,901
  • 18
  • 127
  • 145
faraz khonsari
  • 1,924
  • 1
  • 19
  • 27

2 Answers2

1

I've same NPE on KitKat after upgrading support library to 26.1.0. I think the reason is in FragmentManager changes.

    @Override
    @CallSuper
    public void onAnimationEnd(Animation animation) {
        // If we're attached to a window, assume we're in the normal performTraversals
        // drawing path for Animations running. It's not safe to change the layer type
        // during drawing, so post it to the View to run later. If we're not attached
        // or we're running on N and above, post it to the view. If we're not on N and
        // not attached, do it right now since existing platform versions don't run the
        // hwui renderer for detached views off the UI thread making changing layer type
        // safe, but posting may not be.
        // Prior to N posting to a detached view from a non-Looper thread could cause
        // leaks, since the thread-local run queue on a non-Looper thread would never
        // be flushed.
        if (ViewCompat.isAttachedToWindow(mView) || Build.VERSION.SDK_INT >= 24) {
            mView.post(new Runnable() {
                @Override
                public void run() {
                    mView.setLayerType(View.LAYER_TYPE_NONE, null);
                }
            });
        } else {
            mView.setLayerType(View.LAYER_TYPE_NONE, null);
        }
        super.onAnimationEnd(animation);
    }

EDIT: More info. It happens only if you have custom animations for fragment transactions in your app. After making transaction and starting activity this crash happens

TwRlx
  • 11
  • 2
-1

I advise you to use the new Multidex support library See this link