-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Explain incompatibility between Java versions #5871
Comments
It looks like changing |
i still facing this issue, genkeypair not working for me. Show same error.. please help.. |
I'm having the same issue. I tried just about everything to resolve it for the past 5 hours. But it simply persists. I read that the Java version shipped with Android Studio doesn't have the SHA-256 algorithm. Help would be much appreciated. |
I Solved my problem after about 2 weeks facing this issue, turn out my MAC java is java 18 and android studio default run java 11, so i change my MAC java Home path to run java 11, then run flutter clean create the file keystroke again, then all good now. |
@Alhaadi-IDB Interesting because java 11 didn't have that algorithm. Can you provide more details? What's the output of this command on your machine?
FYI for whoever reads the issue, this is the StackOverflow question: https://stackoverflow.com/questions/67631927/error-building-aab-flutter-android-integrity-check-failed-java-security-n/67632064?noredirect=1#comment119760622_67632064 |
Yes. This works. That's the first thing I saw, however, for some reason, I decided to try everything in the world for 1 entire night before finally trying that and it works like a charm. |
@Alhaadi-IDB That's one way to do it but in my opinion, I'm not sure if it's the best way. So basically by switching to Java 11, you're using a less secure version of SHA which may be a security threat. SHA256withRSA is advisable, but only available from after Java 12. I don't know if the Stack Overflow solution uses SHA256 either, but the terminal warns when we use lesser encryption and that didn't happen. So I'm assuming that's the best option. |
Hi all, as I think I had the same issue. I now tried the command |
If you are still facing this issue, Update Android Studio IDE to the latest version
and press Check Now for checking any updates |
@rongpenl |
Hi @darshankawar, I am not actively monitoring this issue. Sorry for the late reply. I solved the issue on my side with a different way ( as I replied earlier). I guess there are many ways to solve this issue. An update or "warning" on the official site is probably helpful. |
Labeling per above comment. |
This worked for me after struggling for hours. |
I generated keys at the start of the project and they worked fine until recently I got this error. I was able to generate a new key successfully to sign my app bundle. The problem is now when I upload it to the Android play console I get "Your Android App Bundle is signed with the wrong key...." So generating new keys is not a valid solution for me since my app is already in production. Is there a way to add HmacPBESHA256 to an already existing key? |
Hi everyone, I got the same issue yesterday. I deleted my old debug key, which is located at |
I faced the same problem. I tried all the suggested methods, nothing helps. I just can't release an update to the application. |
I gave up and finally had to email google my new keys and have them update them. |
@chris-otani Like you, generating new keys was not an option because our app is already in production and contacting google was such a hassle. As others have pointed out, the build fails because the app was signed with a java version higher than Java 11. But the HmacPBESHA256 algorithm is not available in java 11 which is shipped with Android Studio. So the solution was to get Android Studio to build the aab with your local java version, not java 11. To specify the JDK version, in
After this, I was able to build my aab without any issues with the keys I already had. |
@gracecarrillo It turned out to be impossible to contact google support. Your answer completely solved my problem. Thanks! |
I have spent quite a lot of time on this. Nothing was working for me. instead of: |
@Alhaadi-IDB Thank you! This is what worked for me. I am using zsh and in Mac OS Catalina so I edited .zshrc by adding
save it, close existing terminals and open again to check versions if they are the same already Then I went to add key in /android/app/ (added in .gitignore) Added key.properties in /android (added in .gitignore):
Then Then With result:
|
facing same issue |
|
Hi, I am so thankful. I have tried many things before but it did not work. |
Just change / set the If you are using Arch Linux, it's as easy as: org.gradle.java.home=/usr/lib/jvm/default |
And how did you do that? I think im facing the same issue |
Make sure ur java HOME version is similar with the java version use in Android Studio. Can google on how to check and set the java version for ur OS and Android studio. |
This issue has been documented at https://docs.flutter.dev/release/breaking-changes/android-java-gradle-migration-guide to cover a similar situation. Fixed in #8501. Closing this issue. |
Page URL: https://flutter.dev/docs/deployment/android.html
Page source: https://github.com/flutter/website/tree/master/src/docs/deployment/android.md
Found a typo? You can fix it yourself by going to the page source and clicking the pencil icon. Or finish creating this issue.
Description of issue:
It looks like the latest Android Studio has builtin java 11. And HmacPBESHA256 is only supported starting with java 12. See this stackoverflow question.
Therefore the following error happens when running
flutter build appbundle
.The text was updated successfully, but these errors were encountered: