Search Issue Tracker

Fixed in 2022.2.X

Fixed in 2021.2.X, 2022.1.X

Votes

1

Found in

2021.2.0a17

2021.2.7f1

2022.1

2022.2

Issue ID

1396719

Regression

No

[Android] [IL2CPP] 'MethodAccessException: Attempt to access method' is thrown when using Faster builds IL2CPP Code Generation

IL2CPP

-

How to reproduce:
1. Download the attached project 'ILMethodError.zip'
2. Set IL2CPP Code Generation to Faster (smaller) builds
3. Build and Run 'SampleScene' Scene on Android device
4. Observe logs in logcat

Expected result: No exceptions are seen in logcat
Actual result: MethodAccessException is seen in logcat with following errors:
Error Unity MethodAccessException: Attempt to access method 'System.Collections.Generic.IEnumerable<PokerCore.Model.Achievements.AchievementConfig>.GetEnumerator' on type 'System.Collections.Generic.List<UnityEngine.Events.PersistentCall>' failed.
Error Unity   at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) [0x00000] in <00000000000000000000000000000000>:0 

Reproducible with: 2021.2.0a17, 2021.2.8f1, 2022.1.0b4, 2022.2.0a2
Could not test with: 2019.4.34f1, 2020.3.26f1, 2021.2.0a16 (The required feature is not implemented)

Reproducible with:
VLNQA00288, Samsung Galaxy J7 (SM-J730F), Android 8.1.0, CPU: Exynos 7 Octa 7870, GPU: Mali-T830

Not reproducible with:
VLNQA00316, Samsung Galaxy Note10 (SM-N970F), Android 9, CPU: Exynos 9 Series 9825, GPU: Mali-G76 (app crashes)
VLNQA00001, Google Pixel 2 (Pixel 2), Android 11, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540 (app crashes)
VLNQA00225, Qualcomm null (SDM845 for arm64), Android 8.1.0, CPU: Snapdragon 845 SDM845, GPU: Adreno (TM) 630 (app crashes)
Iphone 11 (iOS 13.5) (app does not load)

Notes:
- The issue can be reproduced on some Android devices only
- The app crashes on standalone and some Android devices
- The app does not load when building on iOS and shows an error in Xcode: Thread 1: EXC_BAD_ACCESS (code=1, address=0x400000082)
- Does not reproduce if IL2CPP Code Generation is set to Faster runtime

  1. Resolution Note (fix version 2022.2):

    Fixed in: 2022.2.0a8

  2. Resolution Note (fix version 2022.1):

    Fixed in: 2022.1.0b14

  3. Resolution Note (fix version 2021.2):

    Fixed in: 2021.2.17f1

Comments (1)

  1. unity_shawn

    Jul 14, 2023 10:08

    07-12 22:43:00.232 16782 10474 E Unity : MethodAccessException: Attempt to access method 'Minim.IComponentWrapper.get_Enabled' on type 'System.String' failed.

    07-14 15:38:00.284 3554 3589 E Unity : MethodAccessException: Attempt to access method 'Minim.IComponentWrapper.get_Enabled' on type 'UnityEngine.GameObject' failed.

    bug still exist with Unity2022.3.0f1 and 2022.3.4f1.

    but there is not a certain way to reproduce.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.