-
Notifications
You must be signed in to change notification settings - Fork 127
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
android build failed #189
Comments
Did you try flutter clean? |
Same problem here, and yes i tried "flutter clean" |
I needed to update my kotlin version to 1.9.22 to compile again... https://plugins.gradle.org/plugin/org.jetbrains.kotlin.android/1.9.22 |
yes i did @Fintasys |
I had the same issue after I upgraded Flutter SDK today.
|
Couldn't reproduce the issue. But I assume it is due some change in Kotlin 1.8 (issuetracker)
Can you try? |
I'm facing the same issue, i try to update the emoji_picker to 2.1.0 from 1.6.4 in flutter 3.19, and the build failed for me. I try to use this options also but dindt work for me android { kotlinOptions { im my opinion its better to downgrade the emoji picker, when i try to upgrade the kotlin, others packages failed, is better to following the same versions as flutter using and waiting for the emoji_picker to fix this erro |
I downgraded Kotlin version in this branch to 1.7.10, can somebody check if that fixes the issue?
|
|
I have the same issue after I upgraded flutter to version 3.19.1 tried:
as well as:
From some googling, seems like these people have a similar issue |
Without a example project to reproduce the issue it is difficult to fix. Based on the link @RasmusGrift96 provided there was one comment with a fix, maybe also worth a try. |
Adding to my pubspec.yaml:
gave the same error for me. As I'm on a different kotlin version, I also tried changed it. (together with the git) this gave me errors in the form of:
So I think I have to be on a newer kotlin version to get my app working. In the new flutter version you had to change some gradle files to get it compatible with the new flutter version. Maybe you can see what is wrong if I post them here: settings.gradle
in my build.gradle:;
I'm not very skilled in kotlin/gradle so if I make some ugly mistakes, I'm happy to learn |
This fix works. Last week we moved our project to 1.9.22 to get emoji_picker_flutter to compile our production app that uses 100+ packages with 600k android installs. Moving to 1.9.22, Gradle 7 produced warnings of mixing old java with java 17 (used by 1.9.22). Fyi these warnings are defaulted to errors in Gradle 8. Our user perceived crash rate had been in the normal range of 0.15%. Updating our user base to the 1.9.22 build the crash rate began climbing, hit 6% within 2 days. 99.9% of the crashes were in android library code when resuming the app from background. Crash rate did not change with the our 500k iOS users. So we looked at android specific changes between releases. We created a fork of emoji_picker_flutter setting kotlin to 1.7.10 and reverted our project back to 1.7.10. The java old/new mix warnings go away. We released this version of the app 2 days ago and crash rate has been restored to sub 0.15%. Again reverting emoji_picker_flutter to 1.7.10 fixes the build and crash issues we were seeing. |
flutter/flutter#125181 (comment) Doing this worked for me, even for Not sure what the issue is., |
working for me |
Nice, This seems to work as well. |
Hello @Fintasys ! Yours is a lovely package, but I was having the same issue. I decided to look into the error and have found following direct instructions from it to be the solution for me. Before looking into what I did, here's the outline of my project configuration:
This might not be relevant if you're on gradle 7..., however, new Gradle requires that every package defines a namespace under subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
} To: subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
} Personally I've been having some issues with R8 minification ( Important changes I've made to my project are at GlitterWare/Passy@6bd7707 and GlitterWare/Passy@addf7a0. You can find the exact project I was building at GlitterWare/Passy@413961c. Feel free to clone this commit and test it out on your end. Now onto changes I've made to your package: It seems that, for some reason, the default value for Here's what your project's ...
android {
compileSdkVersion 34
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
...
}
... I have created a pull request over at #192, merge it if it works for you. Thank you once again for providing this package, it is a wonderful addition to my application. |
Hello @jerryrox @RasmusGrift96 @MBilalMurtaZa , I'm aware that the issue is "fixed" on your end but it would be greatly appreciated if you could try the fork I've created at https://github.com/GlitterWare/emoji_picker_flutter . This will both assist the maintainer in asserting correct behavior across projects and might help you avoid future problems caused by ignoring this error. I can confirm correct behavior across 2 independent Flutter projects with different Gradle versions (8.0-all and 7.6.3-all). To do so, remove the line that you have added earlier to ignore the error and replace the emoji_picker_flutter:
git:
url: https://github.com/GlitterWare/emoji_picker_flutter
ref: ba7e1116380e37bb3fac0d53277dd6937d8849d5 Thank you! |
Deleted the line from the gradle.properties which I added before: Added to my pubspec.yaml:
Worked for me!! Nice job :) |
@GleammerRay I just merged your PR, when I realized we already have this line in package build.gralde
The explicit namespace declaration of your PR should not be required, so I removed it again. |
Oh whoops, my bad, I haven't noticed that. This way of declaration might be more efficient indeed. 😅 |
Just published |
@Fintasys You should close this issue. I can confirm it's fixed.
Unrelated, I had another build error. My settings.gradle needed updating and the plugins block now looks like this:
Many thanks for your work on this plugin. Much appreciated. And thanks to @GleammerRay for the fix. |
i tried to build the apk ,
build got failed
Execution failed for task ':emoji_picker_flutter:compileReleaseKotlin' Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17).
flutter doctor
The text was updated successfully, but these errors were encountered: