-
Notifications
You must be signed in to change notification settings - Fork 540
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: JAVAC : warning : [options] source value 8 is obsolete and will be removed in a future release #9925
Comments
Can someone provide a diagnostic build log which contains the issue . See aka.ms/binlog for details on how to get the required data. |
looks like this was fixed in 165cef7. |
Note we also have #9922 which says we need these values, so we'll have to figure out a solution that addresses both issues. |
Do you have any updates on fix timing or suggestions for workarounds? Unfortunately, I haven't figured out how to ignore this error in my nightly build pipelines. |
This is just a warning, it is not an error. It is safe to ignore it. Your build is still succeeding:
You might be able to make the warning go away by adding this to your project file: <PropertyGroup>
<JavacSourceVersion>17</JavacSourceVersion>
<JavacTargetVersion>17</JavacTargetVersion>
</PropertyGroup> |
I should have mentioned this earlier. I have tried adding the Java Compiler version properties to global prop and target files and the MAUI app project and the warning is still generated. My nightly builds have treat warnings as errors on so they fail with any build warnings. I haven’t figure out any way to suppress these warnings. |
Weird, it seems like we would only set the defaults if they hadn't already been set elsewhere:
I think if you pass them on the command line then they become global properties and cannot be overwritten:
|
The alternative is to set environment variables, they also cannot be overwritten. |
@dellis1972: I suspect that this issue is already addressed by:
Perhaps we need to bring it over? |
Has anyone managed to fix this? |
@pininfarino are you just wanting to hide the warning? or does this cause some other problem? You should be able to use regular MSBuild features to hide the warning like Is the problem gone in .NET 10 previews? |
For me, the problem breaks my CI builds as I have treat warnings as errors turned on. The problem occurs during the signing of the Android package. I haven’t managed to find a fix for this. |
I can't tell from the text log above; if the warning has an error code. Does it have <PropertyGroup>
<WarningsAsMessages>$(WarningsAsMessages);JAVA0000</WarningsAsMessages>
This should be fine, as There is no |
I have not been able to find a solution to prevent the Java error from being outputted as a warning. I think it happens during the Android signing process. I put the following in my solution props file, but it didn't work. I have created a new MAUI project and run dotnet build -bl. Binary logs are zipped below.
Build Log: msbuild.zip |
Ok, so it looks like MSBuild's
Then decides it is a warning, but it logs without an error code if it doesn't "parse" one from the message: It does seem like you should be able to set
Do you have a |
I try adding the following to my csproj file.
I get the following result:
Update .binlog |
Ok, so other parameters also would need to be changed with |
@jonathanpeppers
|
Same here. I had to disable my Maui CI builds as I couldn't figure out a way to suppress the warning. |
Description
After installing latest OpenJDK and Android workload, I now get the following warning when building the default Maui template:
Warnings also appear in Visual Studio.
Building with openjdk version "21.0.6" 2025-01-21 LTS
Maui Android workload: 35.0.50/9.0.100 SDK 9.0.200, VS 17.13.35828.75
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
9.0.50 SR5
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
9.0.40 SR4
Affected platforms
Android
Affected platform versions
Android
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: