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

AbstractMethodError onChangeStart on API 29 #625

Closed mradzinski closed 4 years ago

mradzinski commented 4 years ago

This happens when you call setRoot on a Router only on release builds using Conductor version 3.0.0-RC5:

    java.lang.AbstractMethodError: abstract method "void com.bluelinelabs.conductor.Controller$LifecycleListener.onChangeStart(com.bluelinelabs.conductor.Controller, com.bluelinelabs.conductor.ControllerChangeHandler, com.bluelinelabs.conductor.ControllerChangeType)"
        at com.bluelinelabs.conductor.Controller.changeStarted(Controller.java:1273)
        at com.bluelinelabs.conductor.ControllerChangeHandler.executeChange(ControllerChangeHandler.java:196)
        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.setBackstack(Router.java:457)
        at com.bluelinelabs.conductor.Router.setRoot(Router.java:337)

It doesn't happen in debug builds 🤷‍♂️

mradzinski commented 4 years ago

On Gradle 6.1.1, Adding android.enableDexingArtifactTransform=false to the gradle.properties file seems to fix the issue.

To desugar and dex, Android Gradle plugin uses Gradle artifact tranforms which relies on libraries having the correct Maven information because it uses dependencies specified in POM files to set up the desugaring classpath. This means there's something wrong in Conductor's Maven configuration or one of its dependencies.

EricKuck commented 4 years ago

I haven't been able to reproduce this one. We use rc5 in production without android.enableDexingArtifactTransform=false and it's been fine. Are you using any other libraries that bring in other versions of Conductor? Or perhaps your project isn't set to build with Java 8?

mradzinski commented 4 years ago

Hey @EricKuck. No, this happened on a brand new project with only conductor added into it. I'll see of providing you with a reproduction repo whenever I get some time.

EricKuck commented 4 years ago

This has been fixed in 8575f534366a26230744ce98f6970f2a9e600fbc. I'm not sure what was causing it, but it was something with Java 8. We'll be moving more towards kotlin soon anyway, so this change wasn't needed.