Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(google-maps): jvm target compatibility should be set to the same Java version #1882

Closed
wk-mihai opened this issue Nov 6, 2023 · 5 comments

Comments

@wk-mihai
Copy link

wk-mihai commented Nov 6, 2023

Bug Report

Plugin(s)

  • @capacitor/google-maps": "^5.0.0

Capacitor Version

  • @capacitor/cli: 5.0.0
  • @capacitor/core: 5.0.0
  • @capacitor/android: 5.5.1
  • @capacitor/ios: 5.0.0

Platform(s)

  • Android

Current Behavior

After upgrading the capacitor version from 4 to 5, I've got the following error message when I run the ionic cap run android command:

Execution failed for task ':capacitor-google-maps:compileDebugKotlin'.
[capacitor] > 'compileDebugJavaWithJavac' task (current target is 17) and 'compileDebugKotlin' task (current target is 19) jvm target compatibility should be set to the same Java version.
[capacitor] Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain

This is not happening when I build the app from Android Studio.

Expected Behavior

Should be able to run the ionic cap run android command without the error.

Code Reproduction

Just install the capacitor 5 and @capacitor/[email protected] and run the ionic cap run android command
https://github.com/wk-mihai/capacitor-google-maps-test

Other Technical Details

N/A

Additional Context

This is happening for the latest capacitor version as well (@5.5.1) and latest @capacitor/google-maps version (@5.3.3)

As a temporary fix, I had to change the JavaVersion.VERSION_17 to JavaVersion.VERSION_19 in @capacitor/google-maps/android/build.gradle file

@Ionitron
Copy link
Collaborator

Ionitron commented Nov 6, 2023

This issue needs more information before it can be addressed.
In particular, the reporter needs to provide a minimal sample app that demonstrates the issue.
If no sample app is provided within 15 days, the issue will be closed.

Please see the Contributing Guide for how to create a Sample App.

Thanks!
Ionitron 💙

@wk-mihai
Copy link
Author

wk-mihai commented Nov 6, 2023

I've set the link to the demo app in the main comment.
https://github.com/wk-mihai/capacitor-google-maps-test

@jcesarmobile
Copy link
Member

I can't reproduce with the provided app.
If it works when building from Android Studio, but not from ionic command it might be an Ionic CLI bug.
Also could be some problem on your system, maybe if you have a global gradle installation that is overriding the Capacitor's 5 default gradle version, which is 8.0.0.
Or you have java 19 installed and gradle is using that version, instead of 17, which is what it should be using, as java 19 is not officially supported for Android development yet, despite it can compile if you change the values, it could cause issues.

@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
@wk-mihai
Copy link
Author

wk-mihai commented Nov 7, 2023

You're right. The Java version was 19 instead of 17. Thanks @jcesarmobile

Copy link

ionitron-bot bot commented Nov 22, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants