Search Issue Tracker
Fixed
Votes
0
Found in
2022.3.51f1
6000.0.24f1
6000.1.0a1
Issue ID
UUM-85476
Regression
No
[IL2CPP] RuntimeInitializeOnLoadMethod is stripped/not executed for Android development builds
Steps to reproduce:
1. Open the attached user's project "TestAssemblyStripping.zip"
2. Switch to Android
3. Make sure Development build is enabled
4. Built to android devices
5. Open Android logcat and observe only the "BadBoy Start()" messaged is logged
Expected results: [RuntimeInitializeOnLoadMethod] is executed in Android Development builds
Actual results: [RuntimeInitializeOnLoadMethod] output is stripped/not executed in Android Development builds
Reproducible with: 2022.3.51f1, 6000.0.24f1, 6000.1.0a1
Not reproducible with: 2021.3.45f1
Could not test below 2022.2.0b1 and locate FAV due to gradle build failures
Reproducible with these devices:
VLNQA00381, Xiaomi Redmi Note 8 Pro (Redmi Note 8 Pro), Android 9, CPU: MediaTek Helios G90T MT6785T, GPU: Mali-G76 MC4
VLNQA00528, Hmd Global Nokia G20 (Nokia G20), Android 13, CPU: Mediatek MT6765G Helio G35 (12 nm), GPU: PowerVR Rogue GE8320
VLNQA00422, Samsung Galaxy S21 Ultra 5G (SM-G998B), Android 11, CPU: Exynos 2100, GPU: Mali-G78
VLNQA00282, Samsung Galaxy S10e (SM-G970U), Android 9, CPU: Snapdragon 855 SM8150, GPU: Adreno (TM) 640
S21+ (user)
Testing Environment: Windows 11 23H2
Not reproducible on: no other environment tested
Notes:
-The assembly definition has a constraint (UNITY_EDITOR || DEVELOPMENT_BUILD), but the method is still stripped in development builds
-[Preserve] and [AlwaysLinkAssembly] attributes do not prevent stripping
-The method runs as expected when placed in a MonoBehaviour, but not with the runtime initialization attribute
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [macOS] network permission shows the name of previously closed app when different app requests network access
- Delta value returned by mouse movementsMonitor is different when changing Screen Resolution
- The Radius Scale option is removed from the Visual Effect Graph Output Particle when Lod is disabled in Particles Options
- Visual artifacts appear when the HD Dynamic Resolution Component changes the resolution scale
- Domain Reload loading popup is dark when Editor Theme is set to "Light"
Resolution Note:
Fixed by another internal issue: UUM-84208: [RuntimeInitializeOnLoad] method not called in build when define constraints are used