glassfy/capacitor-plugin-glassfy

Execution failed for task ':capacitor-plugin-glassfy:compileReleaseKotlin'.

Closed this issue · 2 comments

I'm using this plugin with Quasar. Quasar can build Capacitor apps for both iOS and Android. I have it working perfectly fine in iOS. I'm just having trouble getting it to work within the Android build.

I use Quasar to build for Android app: quasar build -m capacitor -T android

I then get the following error:

> Task :capacitor-plugin-glassfy:compileReleaseKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':capacitor-plugin-glassfy:compileReleaseKotlin'.
> 'compileReleaseJavaWithJavac' task (current target is 17) and 'compileReleaseKotlin' task (current target is 18) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

I've tried multiple iterations of changes:

  • Downgrading capacitor-plugin-glassfy to 3.0.0
  • Adding Kotlin version into capacitor.build.gradle file
  • Adding Kotlin version into the parent build.gradle file
  • Asking ChatGPT for input but I keep going in loops with adding a snippet for Kotlin version but it doesn't work
  • Asking Bard for input hasn't cracked it either

Nothing seems to work - except removing capacitor-plugin-glassfy from the capacitor package.json of course - which is not what I want to do.

Here's my Capacitor dependencies for reference:

"dependencies": {
    "@capacitor/android": "^5.0.0-beta.0",
    "@capacitor/app": "^5.0.3",
    "@capacitor/cli": "5.0.5",
    "@capacitor/core": "5.0.5",
    "@capacitor/ios": "^5.0.5",
    "@capacitor/keyboard": "^5.0.4",
    "@capacitor/splash-screen": "^5.0.4",
    "@capacitor/storage": "^1.2.5",
    "capacitor-plugin-glassfy": "3.0.0"
  }

Here's the top of my capacitor.build.gradle file too:

android {
  compileOptions {
      sourceCompatibility JavaVersion.VERSION_17
      targetCompatibility JavaVersion.VERSION_17
  }
}

....

Would love any direction to get the Android built to work with the capacitor-plugin-glassfy reference in the package.json - As I assume that's the ideal scenario.

Thanks in advanced

Hello, sorry but at the moment we do not support Quasar.
The plugin may work but we are not able to provide support.

So I forked your plugin and changed the Java Version from 17 to 18 in android/build.gradle

compileOptions {
        sourceCompatibility JavaVersion.VERSION_18
        targetCompatibility JavaVersion.VERSION_18
}

It then built correctly.