ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.26k stars 1.01k forks source link

[Bug]: Inconsistent JVM-target compatibility detected #7771

Open sake12 opened 1 day ago

sake12 commented 1 day ago

Capacitor Version

Capacitor Doctor

Latest Dependencies:

@capacitor/cli: 6.2.0 @capacitor/core: 6.2.0 @capacitor/android: 6.2.0 @capacitor/ios: 6.2.0

Installed Dependencies:

@capacitor/android: 6.2.0 @capacitor/core: 6.2.0 @capacitor/cli: 6.2.0 @capacitor/ios: 6.2.0

[success] Android looking great! 👌 [error] Xcode is not installed

Other API Details

Android Studio Ladybug | 2024.2.1 Patch 2
Build #AI-242.23339.11.2421.12550806, built on October 24, 2024
Runtime version: 21.0.3+-12282718-b509.11 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 10240M
Cores: 32
Registry:
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
  i18n.locale=
Non-Bundled Plugins:
  Dart (242.22855.32)
  io.flutter (82.1.3)

Platforms Affected

Current Behavior

Task :capacitor-barcode-scanner:compileReleaseKotlin FAILED Execution failed for task ':capacitor-barcode-scanner:compileReleaseKotlin'. Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (17) and 'compileReleaseKotlin' (21).

Expected Behavior

Build should work.

Project Reproduction

https://github.com/sake12/build_fails

Additional Information

No response

sake12 commented 1 day ago

Is it because AndroidStudio updated Java to 21? image

sake12 commented 1 day ago

OK, my bad. They changed bundled version to 21 and i was using it.

https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under

All the products on all the supported platforms already have 64-bit JetBrains Runtime 21 bundled and it will be used by default to run the IDE. If you need to change the runtime to a different version, see below. Please note that all the current IDE versions require at least Java 17 version to run. Our IDEs will not run on the older Java versions like Java 8 or 11.