Search Issue Tracker
By Design
Votes
0
Found in
2019.4
2020.3
2020.3.23f1
2021.2
2022.1
2022.2
Issue ID
1385621
Regression
No
PlayerSettings.Android.targetArchitectures == AndroidArchitecture.All returns false when all architectures are selected
How to reproduce:
1. Open the attached "1385621_Repro.zip" project
2. Open the Player Settings (Edit->Project Settings...->Player)
3. In the Other Settings make sure that Scripting Backend is set to "IL2CPP" and all of the Target Architectures are enabled
4. Open the Scene "SampleScene"
5. Enter the Play Mode
Expected results: "True" is printed in the Console
Actual results: "False" is printed in the Console
Reproducible with: 2019.4.36f1, 2020.3.26f1, 2021.2.8f1, 2022.1.0b4, 2022.2.0a2
Note:
- If all Target Architectures are enabled "PlayerSettings.Android.targetArchitectures" will return the list of them while "AndroidArchitecture.All" returns "All' instead of the list
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
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
- White lighting artifact when a point light with a small emission range and "Hard Shadows" touches an object while a directional light with "Soft Shadows" and another point light are present
Resolution Note:
The PlayerSettings.Android.targetArchitectures returns an integer which has relevant bits set indicating selected architectures, while AndroidArchitecture.All is an integer with all bits set, it's inteded for enabling all architectures, not checking them, the simple "==" comparison will be false, since there are only 4 actual architectures, so only 4 bits are actually used.
The proper way to check if all architectures have been enabled is to get all possible enum values except for None and All and check if all are acounted for. You can get all enum values by calling this:
https://docs.microsoft.com/en-us/dotnet/api/system.enum.getvalues?view=net-6.0