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
- Warning of an unknown Script missing is logged when selecting VFX in Play Mode
- Vertical and horizontal scrollbars appear and disappear when dragging an attribute to a different position within the Shader Graph Hierarchy
- AudioSource.PlayDelayed() does not work with Audio Random Containers
- Compatible with the VFX Graph Shader Graph can't be dragged and dropped into the "Output" block from the Project window
- [Silicon] Freeze/crash on BrotliDecoderDecompressStream when using System.IO.Compression.BrotliDecoder.TryDecompress
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