Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

androidInstall : default or static interface method used without --min-sdk-version >= 24 #50

Closed
odbuser2 opened this issue Apr 10, 2018 · 3 comments

Comments

@odbuser2
Copy link

org.javafxports:jfxmobile-plugin:2.0.19
controlfx 9.0.0 branch
gradle target: androidInstall

Description
ControlFX does not build properly using AndroidInstall : "default or static interface method used without --min-sdk-version >= 24". However, this is what's in AndroidManifest.xml

<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="25"/>

Specifying the minSdkVersion=24 in the build.gradle file results in the same error.

I haven't tracked down the source of the issue in ControlFX but I did try default and static interface methods in my source. Default methods work fine. static interface methods compile but fail to launch on Android. The issue with ControlFX has some other nuance.

The following appears to be the same issue:
Stackoverflow question
Trying "android.enableD8=true" in the gradle.properties file did not fix the issue.

Error

00:02  INFO: Saving lambda class: impl/org/controlsfx/skin/HiddenSidesPaneSkin$$Lambda$6
00:02  INFO: Saving lambda class: impl/org/controlsfx/skin/HiddenSidesPaneSkin$$Lambda$7
00:02  INFO: Saving lambda class: org/controlsfx/control/textfield/TextFields$$Lambda$1
:App:mergeClassesIntoJar
:App:shrinkMultiDexComponents
:App:createMainDexList
:App:writeInputListFile
[ant:java] Java Result: 1
:App:dex FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':App:dex'.
> Uncaught translation error: com.android.dx.cf.code.SimException: default or static interface method used without --min-sdk-version >= 24
  1 error; aborting
@kermiedefrog
Copy link

Did you resolve this issue >>> I am having the same issue with the ControlFX code too ...

@jperedadnr
Copy link
Collaborator

If you want to use ControlsFX on Android with Gluon VM and jfxmobile 2.0.24, you need to use ControlsFX 8.40.15, as ControlsFX 9 uses Java 9 API (and targets Java 9), not supported on Android.

But even using ControlsFX 8 you will get the exception listed above: "default or static interface method used without --min-sdk-version >= 24". This error arises from the use of Android Tools 3.

As the exception message explains, we need to set a min SDK version in order to allow default or static interface methods. This can be done easily from the android configuration block of the build.gradle file:

android {
        manifest = 'src/android/AndroidManifest.xml'
        dexOptions {
            additionalParameters "--min-sdk-version=24"
        }
...

@JulienSt
Copy link

JulienSt commented Jul 4, 2018

@jperedadnr Thank you so much, I had the same problem with a different library. After 2weeks of searching the web I finaly found this github post.
@kermiedefrog yes, this seems to be resolving the problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants