Oculus Build -> InvalidOperationException: The build target does not support build appending.

I’ve searched all over. Can’t even find a reference to this. Anyone have a clue what it means?

I think I recently changed something, but I can’t find what.

This comes from the Oculus Ctrl+K command. Also on the Oculus Menu → OVRBuild → OVRBuild APK and Run.

Any help would be great!

thanks!

From the Log file:

(Filename: Assets/Oculus/VR/Editor/OVRBuild.cs Line: 241)

InvalidOperationException: The build target does not support build appending.
at UnityEditor.BuildPipeline.BuildPlayer (System.String[ ] scenes, System.String locationPathName, System.String assetBundleManifestPath, UnityEditor.BuildTargetGroup buildTargetGroup, UnityEditor.BuildTarget target, UnityEditor.BuildOptions options) [0x00066] in <1fe7a3c0284a456b9681b7a93141c89a>:0
at UnityEditor.BuildPipeline.BuildPlayer (UnityEditor.BuildPlayerOptions buildPlayerOptions) [0x0002b] in <1fe7a3c0284a456b9681b7a93141c89a>:0
at OculusBuildApp.UnityBuildPlayer () [0x00043] in D:\SoftwareDev\TFSOnline\Unity\Unity 19\SnipeHunterVR\Snipes_Quest\Assets\Oculus\VR\Editor\OVRBuild.cs:312
at OculusBuildApp.StartBuildAndRun () [0x000aa] in D:\SoftwareDev\TFSOnline\Unity\Unity 19\SnipeHunterVR\Snipes_Quest\Assets\Oculus\VR\Editor\OVRBuild.cs:246
UnityEditor.EditorApplication:ExecuteMenuItem(String)
UnityEditor.ShortcutManagement.MenuItemEntryDiscoveryInfo:<.ctor>b__7_0(ShortcutArguments)
UnityEditor.ShortcutManagement.Trigger:HandleKeyEvent(Event, IContextManager)
UnityEditor.ShortcutManagement.ShortcutController:HandleKeyEvent(Event)
UnityEditor.ShortcutManagement.ShortcutIntegration:EventHandler()
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()

1 Like

It’s probably something in the Build Settings. Maybe Script-Only Build?

Thanks for the reply @JoeStout.
Unfortunately, that option is grayed out (and not set).

The fact that it’s greyed out is very odd. You’re sure you are set to the Android target?

I’m sure, but always potentially wrong.


It does lead me to wonder if another setting or package is missing.

I can use the Ctrl+B to build and it installs, but doesn’t run.

Do you see anything that jumps out obviously?

Nothing jumps out. But I’m surprised by “I can use the Ctrl+B to build and it installs, but doesn’t run.” I thought the problem was a build error.

If it’s actually building and installing, then what happens when you try to run it (by launching it in Oculus from the “unsupported apps” menu)? Do you understand how to watch the logs with adb?

Ctrl+B works. Oculus menu options for Ctrl+K doesn’t work. Roughly equivalent, but I’m not sure why Oculus added their build options. Maybe they intended to do build appending for a reason (performance? faster build time?)

Ctrl+K did work at one time. Ctrl+B seems to only build and Download, but not run.
I reassembled the project and must have lost something on the way.
I guess I will need to remove and re-add Oculus Integration.

Thanks for taking time to look at this. It’s just odd and really strange that I can’t find anything on it. That usually means I missed something really stupid. Everyone else got it right.

:smiley:

I dunno, I didn’t even know the Ctrl+K thing was a thing. But Ctrl+B should build, download, and run. I don’t know why it’s not doing that for you. Be sure you have developer mode turned on on your headset (though I don’t think you could download if that weren’t set). At the moment, I’m out of ideas.

same issue when try to build unity-library for flutter

InvalidOperationException: The build target does not support build appending.
UnityEditor.BuildPipeline.BuildPlayer (System.String[ ] scenes, System.String locationPathName, System.String assetBundleManifestPath, UnityEditor.BuildTargetGroup buildTargetGroup, UnityEditor.BuildTarget target, UnityEditor.BuildOptions options) (at <1fe7a3c0284a456b9681b7a93141c89a>:0)
UnityEditor.BuildPipeline.BuildPlayer (UnityEditor.BuildPlayerOptions buildPlayerOptions) (at <1fe7a3c0284a456b9681b7a93141c89a>:0)
UnityEditor.BuildPipeline.BuildPlayer (System.String[ ] levels, System.String locationPathName, UnityEditor.BuildTarget target, UnityEditor.BuildOptions options) (at <1fe7a3c0284a456b9681b7a93141c89a>:0)
Build.DoBuildAndroid (System.String buildPath, System.Boolean isPlugin) (at Assets/FlutterUnityIntegration/Editor/Build.cs:55)
Build.DoBuildAndroidLibrary () (at Assets/FlutterUnityIntegration/Editor/Build.cs:23)

for this issue any solution?

I’ve got the same issue here. :frowning:

1 Like

Our build pipeline broke down too when upgrading to 2019.4.14f1. Unity has changed the behaviour of BuildOptions.AcceptExternalModificationsToPlayer. It no longer works with Gradle builds. You have to use EditorUserBuildSettings.exportAsGoogleAndroidProject = true;

Spent a good portion of my day figuring this out.

2 Likes

sorry but I’m new is that means to edit build.cs file?

Sorry should have been more precise. I’m not using any Oculus stuff, but apparently Oculus is making the builds the same way: by adding AcceptExternalModificationsToPlayer build option to export Gradle builds. That needs to be changed as described above. Unfortunately I don’t know anything about Oculus build tools, but maybe somebody who does, can fix it.

But you’re right. Build.cs (or any place that calls BuildPipeline.BuildPlayer) needs to be changed.

1 Like

thanks for replying I’m not using Oculus I’m just using flutter plugin I cant export the project to flutter because of this error :") I hope u tell me how exactly I should edit it!

Same problem whit the build,

EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Gradle;
var options = BuildOptions.AcceptExternalModificationsToPlayer;
var report = BuildPipeline.BuildPlayer(
GetEnabledScenes(),
apkPath,
BuildTarget.Android,
options
);

how should I cheng it?

hey thank you btw i just changed the line of
var options = BuildOptions.AllowDebugging.AcceptExternalModificationsToPlayer;
to something else like that
var options = BuildOptions.AllowDebugging;
and it worked

1 Like

From oculus documentation: “(…) command that utilizes the gradle cache to speed up the build process.”,
if you just remove AcceptExternalModificationsToPlayer you won’t generate the gradle project and might as well just use the unity default build.

Hi, I’m having the same issue, I’m pretty new to unity, does anyone know what exactly needs to be modified/deleted?
I used to be able to build my app perfectly on previous unity versions.

private static UnityEditor.Build.Reporting.BuildReport UnityBuildPlayer()
{
var sceneList = GetScenesToBuild();
var buildPlayerOptions = new BuildPlayerOptions
{
scenes = sceneList.ToArray(),
locationPathName = gradleTempExport,
target = BuildTarget.Android,
options = BuildOptions.AcceptExternalModificationsToPlayer |
BuildOptions.Development |
BuildOptions.AllowDebugging
};

var buildResult = BuildPipeline.BuildPlayer(buildPlayerOptions);

UnityEngine.Debug.Log(UnityBuildPlayerSummary(buildResult));

return buildResult;
}

Thanks!

Maybe you need try these codes brefore BuildPlayer():
Directory.CreateDirectory(gradleTempExport);
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;