0

I want to use Clojure to create a library that I'll use in an Android project.

Experimenting with this, I've made an Uberjar from a test library in Leiningen.

Then I import it into my Android project.

But I'm getting this error :

AGPBI: {"kind":"error","text":"MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)","sources":[{}],"tool":"D8"}

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform file 'mylib.jar' to match attributes {artifactType=android-dex, dexing-enable-desugaring=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.usage=java-runtime-jars}
      > Execution failed for DexingNoClasspathTransform: /media/phil/54AE4F563BCE86E8/DATA/new_dev_tree/small_experiments/clj-jar-for-android/TestAJar/app/libs/mylib.jar.
         > Error while dexing.
   > Failed to transform file 'mylib.jar' to match attributes {artifactType=android-dex, dexing-enable-desugaring=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.usage=java-runtime-jars}
      > Execution failed for DexingNoClasspathTransform: /media/phil/54AE4F563BCE86E8/DATA/new_dev_tree/small_experiments/clj-jar-for-android/TestAJar/app/libs/mylib.jar.
         > Error while dexing.

What exactly is going wrong here? Is it about the Android version? Or the file path? Or something completely different?

interstar
  • 26,048
  • 36
  • 112
  • 180

0 Answers0