Search Issue Tracker

Fixed in Unity 2017.1

Votes

2

Found in

5.6.0f3

Issue ID

904359

Regression

Yes

[Asset Bundles] Building AssetBundles for a different platform than the editor target fails

Build Pipeline

-

-

Priority: 2Necessary for shipping a final release

-

Severity: 3Workaround is possible

1. Open the project attached
2. Notice that the build target is Android and Editor/CreateAssetBundles.cs script is set to build asset bundles for iOS
3. In the top menu click Build-> Build AssetBundles

Result:
1. Pop up error window appears:
"Build failure
Internal error: Target platform mismatch"
2. Errors in console are thrown:
2.1. Menu Edit/Graphics Emulation/OpenGL ES 3.0 can't be checked because it doesn't exist
UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget)
CreateAssetBundles:BuildAllAssetBundles() (at Assets/Editor/CreateAssetBundles.cs:9)

2.2. UnityException: Build failure
Internal error: Target platform mismatch
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex)
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message)
UnityEditor.Android.PostProcessAndroidPlayer.PrepareForBuild (BuildOptions options, BuildTarget target)
UnityEditor.Android.AndroidBuildPostprocessor.PrepareForBuild (BuildOptions options, BuildTarget target)
UnityEditor.PostprocessBuildPlayer.PrepareForBuild (BuildOptions options, BuildTargetGroup targetGroup, BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:86)
UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget)
CreateAssetBundles:BuildAllAssetBundles() (at Assets/Editor/CreateAssetBundles.cs:9)

2.3. Error building Player: UnityException: Build failure
Internal error: Target platform mismatch

Reproduced on: 5.6.0p2, 2017.1.0b1
Did not reproduce on: 5.5.3p2
Regression introduced in 5.6

Comments (1)

  1. F53bd3f72eb170db2eafccbd6407d58c?d=mm

    andersemil

    May 09, 2017 12:37

    What's even worse is that it apparently leaves the editor in an undefined target state since switching target immediately after takes no time at all ...

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.