title: Android use library built with Java 10
body: <p>I want to use a maven generated artifact from another project. However, it is generated using java 10. pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;com.example&lt;/groupId&gt;
  &lt;artifactId&gt;dtos&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;source&gt;10&lt;/source&gt;
                  &lt;target&gt;10&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>In the gradle.properties I add the dependency from local maven repository:</p>
  
  <pre><code>repositories {
      // ...
      mavenLocal()
  }
  dependencies {
      // ...
      implementation 'com.example:dtos:1.0-SNAPSHOT'
  }
  </code></pre>
  
  <p>During compilation I get an error:</p>
  
  <blockquote>
    <p>org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures.
    Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
    ...
    Caused by: java.lang.IllegalArgumentException</p>
  </blockquote>
  
  <p>When I use Java 1.8 when compiling the maven project, the Android project works fine. How can I handle such problem?</p>