-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
GitHub Actions no longer builds MAUI (Android): Java SDK 11.0 or above is required when using .NET 6 or higher #18906
Comments
Hii, I saw a related issue on the runner-images github repo, which should contain a workaround for this issue that you described. It can be found here: actions/runner-images#8837 |
I've seen this mentioned a couple of times now. I think what happens is that the images are being updated to use .NET 8 while your project is still on .NET < (less than) 8. Somehow this error is triggered. A couple of possible solutions here:
As far as I know there is not much we can do about this on our end, this is just the pain with hosted build agents and a period where multiple things update I guess. If someone could confirm that one of these solutions work and which one, that would be great! |
Hi @iamalexmang. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
I get this issue in Azure Pipelines, the error was the same. Fixed it adding this code to pipelines.yml file: - task: JavaToolInstaller@0
displayName: "Install Java Support"
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled' Probably there's a similar workaround for GH Actions. |
@jfversluis the action which started failing I:
This effectively rules out the second bullet point. |
I understand you shouldn't feel like you have to, but this is the problem with using hosted runners that are out of your control. They will update things that might break the config you got running simply because there are so many moving parts and each project is unique. Just as a side-question: why the hesitance to move to .NET 8? In either case, the Java step does fix things as well as other options on this list. Unfortunately this is out of our control and not something we can fix on the SDK side, this is more a build system configuration issue. As such, closing it here. |
I solved this by specifying the java version in the github action
As describe in the page jfversluis pointed to https://github.com/actions/setup-java I understand these are 'moving parts' but I expect a regular net 7.0 MAUI project to still build a week after the release of net 8.0. |
I am of the opinion that even though these are moving parts, as long as a framework is supported and installed, projects targeting that framework and that framework alone should not suddenly stop working because of a fresh new release...
Reason behind not upgrading head-first to a fresh new release of a framework are plenty and cover a spectrum starting from "moving parts" - which are commonly too many for enterprise applications, and end with the inability to support working system, including but not limited to the continuous integration and continuous deployment systems. Second, the reason for using hosted agents, similarly, had to do with the ability to support and be supported by frameworks and systems which are within their support period. For instance, if I'd run the agents myself, I'd require an agent per project, per teams and per builds, so pretty much one for each 5 devs or so. All of these would then have to be maintained and updated not for just one technology, but for the plethora of technologies targeted by the plethora of projects within the organization. Third, it's ridiculous in my humble opinion that if the project targets .NET 7 (which is well within its support period), one would have to upgrade to .NET 8 not because of its benefits, but because of the hosted runner. Let's be honest here: it's Microsoft framework, running after all on Microsoft's agents, targetting Microsoft's workload (MAUI) which stops working not because of a Microsoft framework, but Java, but not because the project is targeting Java, but rather because of an upgrade script or image on the Microsoft agent not properly being installed. This is specifically why
isn't much of an argument. Exactly THIS should be in your control! |
What other options? Again, running setup-dotnet doesn't fix it, nor does installing MAUI. |
this works for me:
|
Description
Starting today the Android builds fail on GitHub Actions using GitHub's runners.
Specifically, a build that ran fine 6h ago, now fails with "Java SDK 11.0 or above is required when using .NET 6 or higher"
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
7.0.101
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
7.0.100
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: