egametang/ET · error · Exception

GenerateStripedAOTDlls failed

Error message

GenerateStripedAOTDlls failed

What it means

Thrown by StripAOTDllCommand when BuildPipeline.BuildPlayer (invoked in buildScriptsOnly mode to produce trimmed AOT assemblies) does not report BuildResult.Succeeded. The exception is a wrapper indicating the underlying Unity player build failed during the strip phase.

Source

Thrown at Packages/cn.etetet.hybridclr/Scripts/Editor/Share/Commands/StripAOTDllCommand.cs:150

                BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions()
                {
                    scenes = EditorBuildSettings.scenes.Where(s => s.enabled).Select(s => s.path).ToArray(),
                    locationPathName = location,
                    options = buildOptions,
                    target = target,
                    targetGroup = BuildPipeline.GetBuildTargetGroup(target),
#if UNITY_SERVER
                    subtarget = (int)StandaloneBuildSubtarget.Server,
#endif
                };

                var report = BuildPipeline.BuildPlayer(buildPlayerOptions);



                if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
                {
                    throw new Exception("GenerateStripedAOTDlls failed");
                }
            }
            finally
            {
                CheckSettings.DisableMethodBridgeDevelopmentFlagChecking = false;
                EditorUserBuildSettings.buildScriptsOnly = oldBuildScriptsOnly;
                EditorUserBuildSettings.SetBuildLocation(target, oldBuildLocation);

                switch (target)
                {
                    case BuildTarget.StandaloneWindows:
                    case BuildTarget.StandaloneWindows64:
                    {
#if UNITY_EDITOR_WIN
                        UnityEditor.WindowsStandalone.UserBuildSettings.createSolution = oldCreateSolution;
#endif
                        break;
                    }

View on GitHub (pinned to 5cab01f7a8)

Solutions

  1. Read the full Unity Editor console / editor.log above this exception -- the actual BuildPlayer failure reason is logged before this wrapper throws.
  2. Fix any compile errors or unresolved references reported in that log, then re-run HybridCLR/Generate/AotDlls.
  3. Verify platform toolchains (JDK/NDK/SDK, Xcode) are installed and configured for the active build target.
  4. Check that the build target and target group match a configuration that supports IL2CPP scripting backend.
Defensive patterns

Strategy: try-catch

Try / catch

try
{
    StripAOTDllCommand.GenerateStripedAOTDlls(target);
}
catch (Exception ex) when (ex.Message.Contains("GenerateStripedAOTDlls failed"))
{
    // The real cause is in the Editor log above this point; surface it to CI.
    Debug.LogError("AOT strip build failed. Check editor.log for the underlying BuildPlayer error.");
    throw;
}

Prevention

When it happens

Trigger: The code sets buildScriptsOnly=true and runs a minimal BuildPlayer into a temp location to force IL2CPP stripping. If report.summary.result != Succeeded, this generic message is thrown, hiding the real cause which is in the preceding Unity build log.

Common situations: Compilation errors in the project; missing scripting define symbols or SDK/NDK misconfiguration for Android/iOS; an AOT-related linker error; disk space or path length issues on the temp build location; UNITY_SERVER subtarget misconfiguration.

Related errors


AI-assisted analysis of egametang/ET@5cab01f7a8 (2026-08-13). Data as JSON: /api/errors/dfd117cdc0f4d985. Report an issue: GitHub.