Search Issue Tracker
By Design
Votes
1
Found in
2021.2.0a20
2021.2.4f1
2022.1
Issue ID
1385257
Regression
Yes
Texture Compression settings on Android and WebGL Platforms are reset to default when building the project using a script
How to reproduce:
1. Open the attached "1385257_Repro.zip" project
2. Open the Build Settings (File->Build Settings...)
3. Switch to Android Platform
4. Set the Texture Compression to "PVRTC (PowerVR)
5. Build the project using the custom menu option (Top of Editor Build Test->Android)
Expected results: After the build finishes the Texture Compressions stays "PVRTC (PowerVR)"
Actual results: After the build finishes the Texture Compressions switches to "Use Player Settings"
Reproducible with: 2021.2.0a20, 2021.2.5f1, 2022.1.0b1
Not reproducible with: 2019.4.33f1, 2020.3.24f1, 2021.2.0a19
Note:
- Script used for building:
new BuildPlayerOptions
{
scenes = new string[] { "Assets/Scenes/SampleScene.unity" },
locationPathName = Application.dataPath + "/../Android_" + EditorUserBuildSettings.androidBuildSubtarget,
target = BuildTarget.Android,
options = BuildOptions.None
});
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
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
Resolution Note (2022.2.X):
This is the expected result since 2021.2 as BuildPlayerOptions now have a subtarget field that must be specified if you want to build for a subtarget different than the default one:
new BuildPlayerOptions
{
scenes = new string[] { "Assets/Scenes/SampleScene.unity" },
locationPathName = Application.dataPath + "/../Android_" + EditorUserBuildSettings.androidBuildSubtarget,
target = BuildTarget.Android,
subtarget = (int)EditorUserBuildSettings.androidBuildSubtarget,
options = BuildOptions.None
});
Notice that when building using a script the active build target is switched to the target platform, and as the code is building for the default subtarget, that is why texture compression is set to the default one.