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
- Text is unreadable when DLSS is applied to the Canvas with Render Mode set to World Space
- NullReferenceException errors appear in the Console when changing the values of Visual Effect Control Clip Events' Attributes
- Crash on TextCore::OTL_TableReader::GetOpenTypeLayoutTables when using Japanese Font as TMP Fallback
- TreeView.AddItem performance regression when opening EditorWindow
- Shadows are not visible in Player when using DX12 with Forward+ or Deferred+ rendering in URP
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