-
Notifications
You must be signed in to change notification settings - Fork 227
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 Gradle plugin 7.0.0+ requires Java 11 to build app #2067
Comments
We can't switch to Android Studio Arctic Fox because of this, which ist required if you want to use Jetpack Compose. Would be nice to get some information about when the update is going to happen. |
We were able to work around the problem by adding a pre-build script (appcenter-pre-build.sh, put next to the module level build gradle file) with the following content:
Don't forget to manually trigger "Save & Build" in the build configuration afterwards. Thanks to Anvesh from Appcenter for pointing us in the right direction. |
I couldn't get harry248's solution to work. However it turns out that if you set the |
Can be used pre-defined environment variable: JAVA_HOME_11_X64 All available java home variables are listed here: https://github.com/actions/virtual-environments/blob/macOS-10.15/20210718.2/images/macos/macos-10.15-Readme.md#Java |
Thank you for this info! Creating a |
Absolutely - this worked for me also |
Thanks this works for me. |
I'm attempting this solution to build an Android project using Gradle, but it seems like the agent can't find JAVA_HOME_11_X64. Here's the details of the agent:
Later on, we see the failure to find the path:
Is it possible that the agent is misconfiguring this environment variable? |
worked for me. name: JAVA_HOME |
Same with me.
|
Update: I got it working by adding:
As regarded by this answer. |
@praharshbhatt Where did you put that snippet? |
in the .yml build file |
I'm using App Center to run a React Native build for Android - I also had to set
|
Getting another issue after adding JAVA_HOME in AppCenter, Same code working in my machine
|
Thanks soooo muuchh!!!! worked here! |
I can't seem to get this to work with my react native android project, I get
|
obviously the path that you set is not a path to jdk. This is what this message means.
…________________________________
From: Rodrigo Vera ***@***.***>
Sent: Friday, November 18, 2022 1:33 AM
To: microsoft/appcenter ***@***.***>
Cc: Stancho Stanchev ***@***.***>; Comment ***@***.***>
Subject: Re: [microsoft/appcenter] Android Gradle plugin 7.0.0+ requires Java 11 to build app (#2067)
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
I can't seem to get this to work with my react native android project, I get
ERROR: JAVA_HOME is set to an invalid directory: /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.17-8/x64/Contents/Home/
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
—
Reply to this email directly, view it on GitHub<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fappcenter%2Fissues%2F2067%23issuecomment-1319348031&data=05%7C01%7Csstanchev%40objectsystems.com%7Cd559934963c0416ee8fe08dac8f41150%7Cdb807785745c4049a031049b258214c0%7C0%7C0%7C638043247837912196%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=4AUk6hzvw0ZB%2BgvSZvx5L0QgQIF8ryghuZrm6dgVFBg%3D&reserved=0>, or unsubscribe<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABYX6GA5BKFIE6DFFY65QRLWI26CZANCNFSM4UNPOBPQ&data=05%7C01%7Csstanchev%40objectsystems.com%7Cd559934963c0416ee8fe08dac8f41150%7Cdb807785745c4049a031049b258214c0%7C0%7C0%7C638043247837912196%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Kd4DM4coxhVsZ8ZWsEyxWXaYCvT05i%2F1L4iwkJPGhUw%3D&reserved=0>.
You are receiving this because you commented.Message ID: ***@***.***>
|
haha I mean that's fair, but I'm using appcenter constants here. So JAVA_HOME_11_X64 would be set but the actual path would leads to nothing? Any way I can force the installation of the Java 11 then? |
Worked for me in my React Native project. My change was not related to targeting Grade 7. But just more the fact that I was targeting Android SDK 31.
|
This workaround makes my project finally build. BUT, when I run the builded apk on a device (or simulator) it crashes just at startup. Anyone having this issue? edit: my project started to get problems when building after i changed sdk target and compile version to 31 |
did you find solution for this ? same problem here |
Not able to set this: $(JAVA_HOME_11_X64) value in environment variable |
Describe the solution you'd like
To support appcenter build with the latest gradle plugin, could you please add Java 11?
Current error code:
Additional context
https://android-developers.googleblog.com/2020/12/announcing-android-gradle-plugin.html
The text was updated successfully, but these errors were encountered: