-
Notifications
You must be signed in to change notification settings - Fork 4.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
AndroidStripILAfterAOT likely causing "InvalidProgramException: Invalid IL code in ..." #104156
Comments
@tipa are you able to share the |
Sure - I shared the file with you in a private message |
Ok, @tipa sent me another But I think the behavior is:
So, it makes me wonder if the crash occurs if the app is launched in a special way (broadcast). |
We are getting this issue:
@FoggyFinder @kevcrooks to see if we can give an apk |
For me, it more and more feels like this is broadcast-related. I now also see some crash reports that originate from another BroadcastReceiver, which is implemented as follows:
And because the crashes don't happen repeatedly for the same users, it could be some race condition |
Long ago there was an issue with isolated broadcast receivers IIRC. The issue was that even though the app was running in the background, the receiver ran in a separate process which didn't have the XA+mono runtime properly initialized and, thus, everything burned and crashed. It doesn't appear to be the case here, but I wonder if it might be a race condition as suggested by @tipa, where the broadcast is received before the main app is fully initialized (e.g. during our very first call to the managed land, the static method |
@jonathanpeppers can we send you an aab file for this and where should we send it to? |
@tipa's problem doesn't occur every time, and we think it is a race condition related to a broadcast receiver. @charlesroddie if you see this issue 100% (as if it crashes every time), can you file a new issue here? The IL strip code lives here: |
The error doesn't occur every time and we only encountered it via an appcenter report. Ours does not involve a BroadcastReceiver, but our app can be launched directly or more rarely via an app link. Generally the bug seems v similar to this one. Assuming it is the same sort of thing going on as above, I would expect our aab file not to have the method in IL, that it will have the method in AOT code, and that something stops it accessing the latter, but I haven't investigated the aab file to confirm any of this. |
I'm still facing this issue. Any update? |
Possibly resolved by #103975. Our next steps with that PR are to measure the performance impact and then we will consider a net8.0 backport |
This should have been fixed. If not, feel free to open a new issue. |
@fanyang-mono Is the fix in the latest .NET8 release? |
@tipa I am afraid not. It should be included in the September release. |
Android application type
.NET Android (net7.0-android, net8.0-android, etc.)
Affected platform version
NET 8.0.100
Description
After adding the
AndroidStripILAfterAOT=true
property to my apps, I started seeing crashes (reported in AppCenter) from my apps in production, e.g.One on of the three crash reports of that app states "Crashed after: 1s", indicating that the app was just cold-booted before crashing.
In another app:
All 4/4 crash reports I got for that app state "Crashed after: 0s".
All seven crash reports were sent from (different) Samsung devices.
All seven crash reports originated from the apps widgets.
Steps to Reproduce
My .csproj look something like this:
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: