-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 AOT] Precompiling failing in .NET 9 #113672
Comments
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
|
Can you please provide a binlog? This should contain the actual error message for us to investigate. You can zip it up, as GitHub will not allow the |
Thanks for reply @jpobst , I have sent the binlog to your email. |
Hmm, it isn't writing any additional error information to the log like I would have expected. I'm going to transfer this to |
Sooooo I had to spend quite some time doing git bisect and trial and error and I found the source of the issue This causes the error [JsonSerializable(typeof(Secrets))]
public partial class SecretsJsonContext : JsonSerializerContext
{ }
public class Secrets
{
public string Url { get; init; } //<---------------
} But this works just fine [JsonSerializable(typeof(Secrets))]
public partial class SecretsJsonContext : JsonSerializerContext
{ }
public class Secrets
{
public string Url { get; set; }
} To conclude
So the issue is a combination of AOT + Source Generator + property with I might need a drink after this |
/cc @lateralusX @BrzVlad |
I suspect this is the same issue as with the other AOT compilation failures. A fix for it would be shipped in April, runtime version 9.0.4. |
@OvrBtn can you try this when the April servicing release comes out and let us know if it's fixed? |
Actually, since you have a small repro, I can give it a spin and see if it resolved the problem. |
Description
Hello, I have a .net 8 project and when I change it to .net 9 it works fine in debug but in release I get this:
If I disable AOT it works fine but I wouldn't want to disable it completely.
I tried building other .net 9 project and it worked.
Also I got this error on github CI/CD so I guess it must be something with the code.
I have no idea how to make smaller reproduction project since the error doesn't point to anyting specific.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
9.0.50 SR5 also tested and confirmed in 9.0.10
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.100 SR10
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: