本文提供全流程,中文翻譯。 Chinar 堅持將簡單的生活方式,帶給世人! (擁有更好的閱讀體驗 —— 高分辨率用戶請根據需求調整網頁縮放比例) |
Chinar —— 心分享、心創新! 助力快速解決 Unity 打包中常見錯誤 給新手節省寶貴的時間,避免採坑! |
1
Change Name —— 未設置修改包名 / 公司名 / 項目名
因爲未設置修改 包名 / 公司名 / 項目名javascript
致使報錯,最爲簡單html
具體錯誤字符: |
---|
UnityException: Package Name has not been set up correctly Please set the Package Name in the Player Settings. The value must follow the convention 'com.YourCompanyName.YourProductName' and can contain alphanumeric characters and underscore. Each segment must not start with a numeric character or underscore.
Error building Player: 2 errors
UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in
Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
解決方案: |
---|
更改 公司名 / 包名 / 項目名
——java
2
SDK Tools —— Unity版本低,須要安卓工具版本也低些
通常高版本的2017.2-2017.3都不會報此錯誤android
常見於 5.X 版本
ruby
具體錯誤字符: |
---|
Error:Invalid command android<br>UnityEditor.HostView:OnGUI()
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
解決方案: |
---|
更換安卓工具包,至較低的版本服務器
1. 點擊下載 —— 安卓工具包 24 版本app
2.解壓後替換 安卓 SDK 中的 Tools 文件夾工具
3.而後從新打包,便可成功!!!
反之:若是 Unity 版本高,一樣須要換成高版本的 安卓 SDK Tools
ui
3
AR Vuforia Android TV —— Vuforia AR 發開中,打包安卓報錯
因爲 Vuforia 不支持 Android TV ,致使報錯spa
具體錯誤字符: |
---|
Vuforia does not support Android TV. Please disable the Android TV compatibility in the Player Settings. UnityEngine.Debug:LogError(Object) BuildObserver:OnPreprocessBuild(BuildTarget, String) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Error building Player: Vuforia does not support Android TV. Please disable the Android TV compatibility in the Player Settings.
Build completed with a result of 'Failed' UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:181 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
解決方案: |
---|
因此須要在 Player Setting 中關閉該選項
便可成功打包工程
4
Quote UnityEditor —— 腳本引用 UnityEditor,沒法打包
打包項目/工程時報錯
Unity Asset 目錄中,若是腳本中引用了 UnityEditor
那麼該腳本就應該放在 Editor 文件夾下 ( 若是沒有,就新建一個名爲 Editor 的文件夾)
具體錯誤字符: |
---|
Assets/CreateGuanJians.cs(4,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?
Error building Player because scripts had compiler errors
Build completed with a result of 'Failed' UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0020e] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:181 at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00065] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:88 UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
解決方案: |
---|
將引用有 UnityEditor 的腳本放在 Editor 文件夾下
( 若是沒有,就新建一個名爲 Editor 的文件夾)
便可成功打包工程
5
Update —— 不斷更新中…….最後聚集全部報錯指南
錯誤不斷更新中…….最後聚集全部報錯指南
請您惠存,支持 Chinar
支持
May Be —— 搞開發,總有一天要作的事!
擁有本身的服務器,無需再找攻略! Chinar 提供一站式教程,閉眼式建立! 爲新手節省寶貴時間,避免採坑! |
先點擊領取 —— 阿里全產品優惠券 (享受最低優惠)
1 —— 雲服務器超全購買流程 (新手必備!)
2 —— 阿里ECS雲服務器自定義配置 - 購買教程(新手必備!)
3—— Windows 服務器配置、運行、建站一條龍 !
4 —— Linux 服務器配置、運行、建站一條龍 !
技術交流羣:806091680 ! Chinar 歡迎你的加入
END
本博客爲非營利性我的原創,除部分有明確署名的做品外,所刊登的全部做品的著做權均爲本人所擁有,本人保留全部法定權利。違者必究 對於須要複製、轉載、連接和傳播博客文章或內容的,請及時和本博主進行聯繫,留言,Email: ichinar@icloud.com 對於經本博主明確受權和許可以使用文章及內容的,使用時請註明文章或內容出處並註明網址