This issue started occurring when I upgraded to 'Unity 6 Preview.'
I investigated this matter and can pinpoint the cause:
BuildReport buildReport = BuildPipeline.BuildPlayer(new BuildPlayerOptions
{
locationPathName = Path.Combine(buildPath, binName),
options = options,
scenes = releaseType.sceneList.GetActiveSceneFileList(),
target = architecture.target,
subtarget = (int)architecture.subtarget
});
- For Android, the
subtarget is an enum MobileTextureSubtarget.
- When creating
BuildArchitecture for Android, we don’t pass the fifth argument, so the default parameter value is StandaloneBuildSubtarget.Player
StandaloneBuildSubtarget.Player equals 2, meaning subtarget = 2, which corresponds to MobileTextureSubtarget.PVRTC
If you specify something like subtarget = (int)EditorUserBuildSettings.androidBuildSubtarget, it works correctly, but obviously, that’s not the solution. :)
This issue started occurring when I upgraded to 'Unity 6 Preview.'
I investigated this matter and can pinpoint the cause:
subtargetis an enumMobileTextureSubtarget.BuildArchitecturefor Android, we don’t pass the fifth argument, so the default parameter value isStandaloneBuildSubtarget.PlayerStandaloneBuildSubtarget.Playerequals 2, meaningsubtarget = 2, which corresponds toMobileTextureSubtarget.PVRTCIf you specify something like
subtarget = (int)EditorUserBuildSettings.androidBuildSubtarget, it works correctly, but obviously, that’s not the solution. :)