unable to build a player with BuildPipeline

Hello Everyone,

is anyone able to build a player using the new BuildPipeline ?

Error:

Build ClassicBuildSettings failed in BuildStepBuildClassicPlayer after 41.44m.
Invalid or unhandled enum Android (index 13)
  at Unity.Build.Common.ClassicBuildProfile.GetExecutableExtension () [0x00062] in C:\UnityProjects\CWBR_versions\CenturyWarsBattleRoyale_GO\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Build.Common\Settings\ClassicBuildProfile.cs:80
  at Unity.Build.Common.BuildStepBuildClassicPlayer.Prepare (Unity.Build.BuildContext context, Unity.Build.BuildStep step, System.Boolean liveLink, Unity.Build.Common.TemporaryFileTracker tracker, Unity.Build.BuildStepResult& failure, UnityEditor.BuildPlayerOptions& buildPlayerOptions) [0x000e2] in C:\UnityProjects\CWBR_versions\CenturyWarsBattleRoyale_GO\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Build.Common\Steps\BuildStepBuildClassicPlayer.cs:62
  at Unity.Build.Common.BuildStepBuildClassicPlayer.RunBuildStep (Unity.Build.BuildContext context) [0x0000c] in C:\UnityProjects\CWBR_versions\CenturyWarsBattleRoyale_GO\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Build.Common\Steps\BuildStepBuildClassicPlayer.cs:118
  at Unity.Build.BuildPipeline.RunBuildSteps (Unity.Build.BuildContext context) [0x00100] in C:\UnityProjects\CWBR_versions\CenturyWarsBattleRoyale_GO\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Build\BuildPipeline.cs:241
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
Unity.Build.BuildPipelineResult:LogResult() (at Library/PackageCache/com.unity.entities@0.2.0-preview.18/Unity.Build/BuildPipelineResult.cs:126)
Unity.Build.<>c:<.cctor>b__43_0(BuildSettings) (at Library/PackageCache/com.unity.entities@0.2.0-preview.18/Unity.Build/BuildSettingsScriptedImporterEditor.cs:41)
Unity.Build.<>c__DisplayClass34_0:<RefreshHeader>b__1() (at Library/PackageCache/com.unity.entities@0.2.0-preview.18/Unity.Build/BuildSettingsScriptedImporterEditor.cs:229)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

ClassicBuildSettings:

I can build for Standalone Windows x64 using the new build pipeline. Have you tried switching targets to see if this is an android target specific issue?

Can you show me the contents of Packages/manifest.json in your project folder?

@Tomas1856

{
  "dependencies": {
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.2d.tilemap": "1.0.0",
    "com.unity.addressables": "1.4.0",
    "com.unity.analytics": "3.3.2",
    "com.unity.collab-proxy": "1.2.16",
    "com.unity.entities": "0.2.0-preview.18",
    "com.unity.ext.nunit": "1.0.0",
    "com.unity.ide.rider": "1.1.0",
    "com.unity.ide.vscode": "1.1.3",
    "com.unity.memoryprofiler": "0.1.0-preview.9",
    "com.unity.physics": "0.2.4-preview",
    "com.unity.purchasing": "2.0.6",
    "com.unity.render-pipelines.core": "7.1.6",
    "com.unity.render-pipelines.universal": "7.1.6",
    "com.unity.rendering.hybrid": "0.2.0-preview.18",
    "com.unity.shadergraph": "7.1.6",
    "com.unity.test-framework": "1.1.8",
    "com.unity.textmeshpro": "2.1.0-preview.2",
    "com.unity.timeline": "1.2.6",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  }
}

Today, building to platforms other than Standalone is not supported, and currently it’s just a wrapper around old BuildPipeline.BuildPlayer.

In the long run BuildTarget will be removed from ClassicBuildProfile and instead we’ll have a build pipeline per platform, so for ex., AndroidHybridBuildPipeline. Can’t say when it will happen yet, stay tuned.

Sorry for the inconvience.

1 Like

So how can I build a player for Android when I’m using subscenes if it’s no longer available from the standard build process ?
Should i go back to the entities 0.1 ?
I think this is something you should say in your packages updates.

1 Like

Yes, you’re right.

We’ll provide a temporary fix in com.unity.entities 0.3.0, should be available this month.

5 Likes

Hi, I had the same problem and solved it by updating to com.unity.entities 0.3.0-preview.4.

However my general problem is that I use SubScenes and I wanted to test them on android devices.

But their Bundles, Binaries and Headers are saved within the StreamingAssets path. In documentation it is stated that there is no direct file access possible on Android.

As result I get an Error when loading SubScenes: E/Unity: Loading Entity Scene failed because the entity header file could not be found: 7046bdfc36a0a8a4a9e7e199582047f9 NOTE: In order to load SubScenes in the player you have to use the new BuildSettings asset based workflow to build & run your player.

For info on iOS it works fine except I had to add iOS as well to the switch case that failed the builds like on Android with entities 0.2.0.

Now I have the question if it makes sense to work around it in meantime, by creating a async “file://” request to load the header, instead of the File.Exists(sceneHeaderPath).
Or do I have to expect that I will have the same issue with the other paths again?

1 Like

im having the same issue now

Also the player’s size is doubled

hello @Tomas1856 ,
just to be sure that unity teams know about these bugs:
the Entities 0.3 Package is not working correctly for android:

  1. the player’s size is doubled.
  2. SubScenes are not working for Android with error:
    E/Unity: Loading Entity Scene failed because the entity header file could not be found: 7046bdfc36a0a8a4a9e7e199582047f9 NOTE: In order to load SubScenes in the player you have to use the new BuildSettings asset based workflow to build & run your player.

Hello @Opeth001 and @Tomas1856 ,

It seems that Entities Version 0.4.0-preview 10 solved the Issue #2, Subscenes are working now on Android.

But @Tomas1856 will there be proper dependency management like in the Unity Addressables system or even be compatible with the Addressables systems dependency management?

Which means if I put assets like textures that are shared between multiple subscenes into a seperate asset group, that they are only loaded/stored once, not for all subscenes.

This would also kinda solve @Opeth001 problem #1 as well.

@Tomas1856 sadly I also found out that the unity light baking workflow is not supported for subscenes.

Is there any ETA for:
a) Subscene dependency management
b) Light baking for subscenes

I’m trying to use subscenes on the Quest. I have my target set to Android in the ClassicBuildSettings. It builds but the subscenes don’t show up on the device. I can see them fine in play mode in the editor. Am I forgetting a step? I have the scenes in the scene list as well.

1 Like

if you used the new pipeline to build it, might just be a bug and most likely worth reporting to unity. can you try building it out for desktop to quickly verify its working there?

Did you change pipeline from Hybrid to AndroidHybrid? That did it for me.

I forgot two things. The pipeline was set to hybrid instead of androidHybrid and I didn’t have the classic scripting component added to the buildSettings.

1 Like

Edit: It’s working fine now… see my post below to see how I fixed it.

Where are you guys getting this “ClassicBuildSettings” file?

I tried going here: https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/ECSSamples/Assets/BuildConfigurations and using Win64-Build.buildconfiguration and then I added my scene and subscene, but when I built I got:

Error message

Build Win64-Build failed after 57.79s.
UnityEditor.Build.Reporting.BuildSummary
UnityEngine.Debug:LogError(Object, Object)
Unity.Build.ResultBase:LogResult() (at Library/PackageCache/com.unity.platforms@0.9.0-preview.9/Editor/Unity.Build/ResultBase.cs:60)
Unity.Build.Editor.<>c:<.cctor>b__29_1(BuildConfiguration) (at Library/PackageCache/com.unity.platforms@0.9.0-preview.9/Editor/Unity.Build.Editor/BuildConfigurationInspector.cs:45)
Unity.Build.Editor.<>c__DisplayClass25_0:b__0() (at Library/PackageCache/com.unity.platforms@0.9.0-preview.9/Editor/Unity.Build.Editor/BuildConfigurationInspector.cs:106)
UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

I have no idea what that error message means… It tells me nothing useful. I never heard of this “new BuildPipeline” until today. If building with subscenes is this much of a hassle on Windows, I am really not looking forward to the stuff you guys are going through on Android.

I got it building… I got rid of the error I was getting above by checking one of the boxes for Auto Load. After that, it complained about building into a directory that had been built with mono instead of il2cpp, so i removed the build directory. After that it built, but it ran at around 5fps and the transparency was all messed up (I think maybe it was using hybrid renderer v1 instead of v2?)

So the solution that worked was to go to Assets/Create/Build/Windows Classic Build Configuration and then add my scenes and subscenes. Runs like a champ now!