Unity安卓构建后无法运行:找不到Player程序集求助
Android构建后仅显示“Made with Unity”无交互,伴随UnityEngine.TestRunner.dll找不到警告
问题场景
- 简易2D Unity游戏,Android平台构建成功,启动后仅显示Unity启动页,无任何交互响应
- 构建过程中编辑器抛出警告:
Unable to find player assembly: C:\Users\Administrator\My project\Temp\StagingArea\Data\Managed\UnityEngine.TestRunner.dll UnityEngine.Debug:LogWarning (object) Unity.Burst.Editor.BurstAotCompiler:OnPostBuildPlayerScriptDLLsImpl (UnityEditor.Build.Reporting.BuildReport) (at Library/PackageCache/com.unity.burst@1.6.6/Editor/BurstAotCompiler.cs:350) Unity.Burst.Editor.BurstAotCompiler:OnPostBuildPlayerScriptDLLs (UnityEditor.Build.Reporting.BuildReport) (at Library/PackageCache/com.unity.burst@1.6.6/Editor/BurstAotCompiler.cs:208) UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()
- 已尝试网络通用方案,问题未解决
针对性排查与修复步骤
1. 清理Test Runner相关引用
- 打开
Window > Package Manager,找到Test Framework包,点击移除,重启Unity - 检查项目所有目录,删除残留的测试脚本(包括放在
Editor/Test文件夹外的测试代码),再重新构建
2. 修复Burst包与AOT配置
- 在Package Manager中移除Burst包,重新安装同版本(1.6.6)或兼容的最新版本
- 打开
Edit > Project Settings > Player > Android > Other Settings:- 确认
Scripting Backend设置为IL2CPP或Mono(若选IL2CPP,需确保已安装对应Android NDK) - 暂时关闭
Burst Compilation选项,尝试构建;若正常运行,再重新开启该选项测试
- 确认
3. 彻底清理项目缓存
- 删除项目根目录下的
Temp、Library、obj文件夹,以及Build目录中的Android构建产物 - 重新打开Unity,等待项目资源完全导入后,再次执行Android构建
4. 验证启动场景与基础设置
- 打开
File > Build Settings,确认游戏主场景已添加至Scenes In Build列表,且排在首位 - 检查Player Settings中的
Default Orientation是否与场景适配,避免因方向问题导致交互失效
5. 手动补充缺失DLL(临时应急方案)
- 从Unity安装目录的
Editor\Data\Managed文件夹中找到UnityEngine.TestRunner.dll - 将其复制到警告提示的路径:
C:\Users\Administrator\My project\Temp\StagingArea\Data\Managed\,再重新打包
内容的提问来源于stack exchange,提问作者harrypotteryeah
相关产品推荐
相关产品推荐

