Search Issue Tracker
Duplicate
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
- GPU utilization increases by 20% on Meta Quest headsets when Render Graph is enabled on 6000.0.16f1 and higher
- Value on Slider (Int) control in UI Builder displays as default when saving UI Document
- Color mismatch in UI Builders Library panel when the Editors theme is set to Light Mode
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
- Non-HDR color picker opens when selecting material color with HDR enabled
Resolution Note:
null
Duplicate of another internal issue: UUM-84208: [RuntimeInitializeOnLoad] method not called in build when define constraints are used