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
- After converting a Built-in project to URP render texture related errors are spammed that can lead to Game view being rendered on top of Scene view
- UI Builder slider value lags and stutters when sliding/modifying certain property values
- "Reset UI Builder Layout" functionality inconsistently changes Canva Size when "Match Game View" is enabled/disabled
- Texture Import Warnings are obscured by other Terrain Layer options in the Inspector
- Burst Inspector middle divider is jittering when resized with the Burst Inspector window docked
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