has anyone tried using javafx plugin in shared bui...
# compose-desktop
k
has anyone tried using javafx plugin in shared build.gradle? getting this error when i add the plugin "The 'java' plugin has been applied, but it is not compatible with the Android plugins."
1
k
Same @Kashismails, if you found anything please let me know
a
The javafx pluging won't work with the android plugin. But it does work with the
kotlin("jvm")
plugin
s
I am
compileOnly
it in shared.
Copy code
val desktopMain by getting { 
             dependencies { 
                 // javafx 
                 val hostOs = System.getProperty("os.name") 
                 val platform = when { 
                     hostOs == "Mac OS X" -> "mac" 
                     hostOs == "Linux" -> "linux" 
                     hostOs.startsWith("Windows") -> "win" 
                     else -> throw GradleException("Host OS is not supported javafx.") 
                 } 
                 compileOnly("org.openjfx:javafx-base:${Versions.Java.java}:$platform") 
                 compileOnly("org.openjfx:javafx-graphics:${Versions.Java.java}:$platform") 
                 compileOnly("org.openjfx:javafx-swing:${Versions.Java.java}:$platform") 
                 compileOnly("org.openjfx:javafx-web:${Versions.Java.java}:$platform") 
             } 
         }
k
m
As a side note. JavaFX is not tied to a specific Java version. You can always use the latest version of it with a reasonably recent Java version.
a
you are adding something in the
plugins
block
Copy code
plugins {
  // some javafx plugin
}
That is the section that doesn't work with the android plugin
k
Didn't get it, any code snippet or repo for it guys ???
k
@Kapil Yadav https://t.co/sg2mjcgNim checck this branch
k
Thanks big boss
Anyone help with this, using WebView