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

Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin #1564

Closed
3 tasks done
kbrownlees opened this issue Mar 7, 2023 · 1 comment · Fixed by #1594
Closed
3 tasks done

Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin #1564

kbrownlees opened this issue Mar 7, 2023 · 1 comment · Fixed by #1594
Milestone

Comments

@kbrownlees
Copy link

kbrownlees commented Mar 7, 2023

Bug Report

Problem

What is expected to happen?

The build to complete successful.

What does actually happen?

The build fails with an error of Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1

Information

Some more context in #1543.

This started happening for two of our developers in the last week or so. I was not able to lock down the exactly change which triggered this, but it is a tooling change rather than code changes since we have not done any cordova package upgrades in the last few months.

The workaround is to add <preference name="GradlePluginKotlinVersion" value="1.7.22"/> to your config.xml.

Command or Code

Attempt to build android, either via the command line or android studio.

Version information

cordova@11
cordvoa-android@11
MacOS Ventura
Android Studio 2022.1.1 Patch 2

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@AlexPashley
Copy link

I can confirm adding <preference name="GradlePluginKotlinVersion" value="1.7.22"/> to your config.xml as @kbrownlees suggested worked, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants