bluelinelabs / Conductor

A small, yet full-featured framework that allows building View-based Android applications
Apache License 2.0
3.9k stars 343 forks source link

Fatal Exception: java.lang.NullPointerException #628

Open TikTak123 opened 4 years ago

TikTak123 commented 4 years ago

Conductor version: implementation 'com.bluelinelabs:conductor:3.0.0-rc6'

API level: Android 5, 6, 7, 8, 9, 10

Error log:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.animation.Animator.addListener(android.animation.Animator$AnimatorListener)' on a null object reference
       at com.bluelinelabs.conductor.changehandler.AnimatorChangeHandler.performAnimation(AnimatorChangeHandler.java:182)
       at com.bluelinelabs.conductor.changehandler.AnimatorChangeHandler.performChange(AnimatorChangeHandler.java:139)
       at com.bluelinelabs.conductor.ControllerChangeHandler.executeChange(ControllerChangeHandler.java:209)
       at com.bluelinelabs.conductor.ControllerChangeHandler.executeChange(ControllerChangeHandler.java:159)
       at com.bluelinelabs.conductor.Router.performControllerChange(Router.java:834)
       at com.bluelinelabs.conductor.Router.performControllerChange(Router.java:799)
       at com.bluelinelabs.conductor.Router.performControllerChange(Router.java:777)
       at com.bluelinelabs.conductor.Router.popController(Router.java:137)
       at com.bluelinelabs.conductor.Router.popCurrentController(Router.java:119)
       at com.bluelinelabs.conductor.Router.handleBack(Router.java:97)
       at com.example.MainActivity.onBackPressed(MainActivity.java:269)
       at android.app.Activity.onKeyUp(Activity.java:2864)
       at android.view.KeyEvent.dispatch(KeyEvent.java:3358)
       at androidx.core.view.KeyEventDispatcher.activitySuperDispatchKeyEventPre28(KeyEventDispatcher.java:137)
       at androidx.core.view.KeyEventDispatcher.dispatchKeyEvent(KeyEventDispatcher.java:87)
       at androidx.core.app.ComponentActivity.dispatchKeyEvent(ComponentActivity.java:140)
       at androidx.appcompat.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:569)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
       at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.dispatchKeyEvent(AppCompatDelegateImpl.java:3054)
       at androidx.appcompat.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)
       at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:428)
       at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:5007)
       at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4969)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4504)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4557)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4523)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4656)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4531)
       at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4713)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4504)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4557)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4523)
       at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4531)
       at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4504)
       at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4557)
       at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4523)
       at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4689)
       at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4858)
       at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:3036)
       at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:2574)
       at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:2565)
       at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:3013)
       at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:323)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:6682)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
EricKuck commented 4 years ago

Which change handler is this happening with? A built-in one or a custom one? Can you share the getAnimator method if it's custom?

TikTak123 commented 4 years ago

use this one https://github.com/bluelinelabs/Conductor/blob/develop/demo/src/main/java/com/bluelinelabs/conductor/demo/changehandler/CircularRevealChangeHandler.java