Capacitor-Google-Maps Not Building - Unknown Kotlin JVM Target: 21

I’m facing an issue where my Android app fails to build on VoltBuilder due to a problem with the @capacitor/google-maps plugin. The build fails with the following error: UserError: FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ‘:capacitor-google-maps:compileDebugKotlin’.

Unknown Kotlin JVM target: 21

  • My local android/app/build.gradle does not explicitly set kotlinOptions { jvmTarget = “21” }. I suspect this setting is either inherited from the @capacitor/google-maps plugin’s Gradle configuration (e.g., in node_modules/@capacitor/google-maps/android/build.gradle) or applied by VoltBuilder’s default build environment.
  • The error indicates that the Kotlin compiler version in use doesn’t support JVM target 21, suggesting it’s likely below version 1.9.20, while Java 21 is being enforced.

Can you confirm the Kotlin version used with Gradle 8.2.1 and Java 21 in your
environment? If it’s less than 1.9.20, that might explain the issue.

The Kotlin version in our environment is 2.0.20. Please let us know what you find. If you need a hand you can always share your project with support@volt.build.

Reviewing the log that you sent, I notice you are on capacitor 6 - does upgrading to capacitor 7 help things?

Additionally, there is a newer version of @capacitor/google-maps that may resolve this issue.

The log I sent shows my project using Capacitor 6. You mentioned upgrading to Capacitor 7 might help. I’m hesitant to upgrade immediately since this same setup worked two weeks ago with the same versions and not getting this issue capacitor-google-maps:compileDebugKotlin’.

Unknown Kotlin JVM target: 21

We recently upgraded our systems to support Capacitor 7, which requires JVM 21. Apparently your plugin isn’t compatible with JVM 21, causing this error. I can look into modifying our platform to allow you to specify a JVM version, but in the long term I would suggest upgrading.

Please let me know which route you plan to take. You might also try using the newer version of the plugin with capacitor 6.

I’ve made a modification to our build agents so that JVM 17 is used for capacitor versions less than 7. Please give it another try.

I have error now after updating in ios not build in voltbuild
`ServerError: Capacitor build for ios failed
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace App.xcworkspace -scheme App -configuration Release -destination generic/platform=iOS -archivePath App.xcarchive archive

ComputePackagePrebuildTargetDependencyGraph

Prepare packages

CreateBuildRequest

SendProjectDescription

CreateBuildOperation

ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (20 targets)`

Can you provide your build ID or log so we can take a closer look?

this is my bundle id : 425ffc14-e95e-45f4-aaea-ca372740f61b

If you review your log, you’ll notice this message:

/ios/App/App/AppDelegate.swift:2:8: error: compiling for iOS 13.0, but module 'Capacitor' has a minimum deployment target of iOS 14.0

Change your deployment target to 14 and you should be able to move forward.