-
Notifications
You must be signed in to change notification settings - Fork 124
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
Compilation issue after upgrading to Android Studio Ladybug | 2024.2.1 #186
Comments
Maybe Android Studio is using newer Java / Gradle / AGP / Gradle Kotlin plugin? I have no AS installed so I cannot reproduce it now. You can look into the detailed logs and (hopefully) find more specific information. |
The workaround is similar to last time (#154): subprojects {
afterEvaluate {
if (project.plugins.hasPlugin("com.android.application")
|| project.plugins.hasPlugin("com.android.library")) {
if (project.name == "flutter_nfc_kit") {
project.android.compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
}
}
}
} And to your kotlin {
jvmToolchain(21)
} Not sure what is going on, why this is needed, and why it's always this plugin, as its gradle settings seem perfectly reasonable. Also, building with Android studio is possible without any workaround, for some reason. |
I'm having the same problem here
would be cool to have a real fix for this issue and not only this workaround |
I'm having the same problem, but when I set those configurations the error become "Unknown Kotlin JVM target: 21". anyone knows why?
|
I am on the same scenario here. Can't build no matter what. |
For workaround until this gets fixed, manually update the For For compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
} |
@larssn I've just tried using your plugin in our pipeline after seeing your PR. Imported your plugin with:
Before using your plugin, we were getting this error:
After changing it to your github fork, we got slightly different error, but still:
Any ideas? |
Do you have any workarounds forcefully specifying the kotlin toolchain? Example: kotlin {
jvmToolchain(21)
} If so, try removing that, as gradle should be able to detect the correct settings to use. |
I can compile without using a slightly different setting in build.gradle both in example/android/app and android/ android {
May be we need to specify the 8.8 instead of the 1.7 version for compatibility now. |
Here's how I made it work for my situation. Keep the default options you get from a new project.
In my situation it was a mismatch versioning from Java and Gradle that was causing the issue. Here for more info. I also found this dependency manager to work for me for managing gradle and Java versions. |
The exact version of Android Studio is
Build #AI-242.21829.142.2421.12409432, built on September 24, 2024
I can no longer compile a project that uses flutter_nfc_kit.
The compilation error is:
The funny part is that I've made no changes to the source project, AND am using VSCode to compile it.
I can only assume that the latest Android Studio upgrade has changed the build environment.
I've tried a
flutter clean
to no avail.The text was updated successfully, but these errors were encountered: