New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D8: Invoke-customs are only supported starting with Android O (--min-api 26) #265

joshfriend opened this Issue Oct 12, 2018 · 2 comments


None yet
2 participants

joshfriend commented Oct 12, 2018

Library version: 1.0.0

Repro steps or stacktrace:


  • Gradle 4.10.2
  • Android Gradle Plugin 3.2.1 (also duplicated with 3.2.0)
  • Android build tools 28.0.3
  • Kotlin 1.2.71

Upgrading autodispose from 1.0.0-RC2 to 1.0.0 results in build failures when using R8 to generate a minified build:

> Task :app:transformClassesAndResourcesWithR8ForDebugMinified
D8: Invoke-customs are only supported starting with Android O (--min-api 26)

> Task :app:transformClassesAndResourcesWithR8ForDebugMinified FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithR8ForDebugMinified'.
> Compilation failed to complete

This comment has been minimized.

joshfriend commented Oct 12, 2018

I tried adding this to the toplevel app's build.gradle:

compileOptions {
  sourceCompatibility JavaVersion.VERSION_1_8
  targetCompatibility JavaVersion.VERSION_1_8

which worked, but is there a way to avoid that?


This comment has been minimized.


hzsweers commented Oct 12, 2018

AutoDispose is a Java 8 library, with the expectation that consumers are using Java 8-targeting android apps and D8/desugar tools as needed for supporting older versions of android that don't support java 8

Per the changelog here:

Basically - there's no reason not to use the source/target compatibility you listed + D8 on android projects as of android gradle plugin 3.2.0.

@joshfriend joshfriend closed this Oct 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment