release模式后报错



  • 程序在debug模式下没有任何问题,但是在打包成release模式后,某些功能点会有一定几率发生这个空指针错误,且程序闪退。
    04-05 17:56:57.698: E/AndroidRuntime(2445): java.lang.NullPointerException: Attempt to invoke virtual method 'void com.facebook.react.uimanager.ReactShadowNode.setStyleWidth(float)' on a null object reference

    04-05 17:56:57.698: E/AndroidRuntime(2445): at com.facebook.react.uimanager.UIImplementation.updateNodeSize(UIImplementation.java:156)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at com.facebook.react.uimanager.UIManagerModule.updateNodeSize(UIManagerModule.java:249)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at com.facebook.react.views.modal.ReactModalHostView$DialogRootViewGroup$1.runGuarded(ReactModalHostView.java:313)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:21)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at android.os.Handler.handleCallback(Handler.java:739)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at android.os.Handler.dispatchMessage(Handler.java:95)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at android.os.Looper.loop(Looper.java:158)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)

    04-05 17:56:57.698: E/AndroidRuntime(2445): at java.lang.Thread.run(Thread.java:818)


登录后回复