Unity打安卓包 Android 所有錯誤解決方案大全(幾乎囊括所有打包錯誤 )
阿新 • • 發佈:2018-12-31
Chinar 堅持將簡單的生活方式,帶給世人! (擁有更好的閱讀體驗 —— 高解析度使用者請根據需求調整網頁縮放比例) |
助力快速解決 Unity 打包中常見錯誤 給新手節省寶貴的時間,避免採坑! |
1
Change Name —— 未設定修改包名 / 公司名 / 專案名
由於未設定修改 包名 / 公司名 / 專案名
導致報錯,最為簡單
具體錯誤字元: |
---|
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)
解決方案: |
---|
更改 公司名 / 包名 / 專案名
——
2
SDK Tools —— Unity版本低,需要安卓工具版本也低些
一般高版本的2017.2-2017.3都不會報此錯誤
常見於 5.X 版本
具體錯誤字元: |
---|
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.
解決方案: |
---|
更換安卓工具包,至較低的版本
2.解壓後替換 安卓 SDK 中的 Tools 資料夾
3.然後重新打包,即可成功!!!
反之:如果 Unity 版本高,同樣需要換成高版本的 安卓 SDK Tools
3
AR Vuforia Android TV —— Vuforia AR 發開中,打包安卓報錯
由於 Vuforia 不支援 Android TV ,導致報錯
具體錯誤字元: |
---|
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
Socket: bind failed, error: —— 套接字繫結失敗
開啟/新建 Unity 專案時報錯
這是由於許可權不夠,或者網路埠被佔用造成的
具體錯誤字元: |
---|
Socket: bind failed, error: 以一種訪問許可權不允許的方式做了一個訪問套接字的嘗試。
(0)
Unable to join player connection multicast group.
解決方案: |
---|
1. 直接 Clear 清空控制檯,不用理它
2. 用管理員許可權開啟 Unity (可選)
5
Update —— 不斷更新中…….最後彙集所有報錯指南
錯誤不斷更新中…….最後彙集所有報錯指南
請您惠存,支援 Chinar
支援
May Be —— 搞開發,總有一天要做的事!
Chinar 提供一站式教程,閉眼式建立! 為新手節省寶貴時間,避免採坑! |
技術交流群:806091680 ! Chinar 歡迎你的加入
本部落格為非營利性個人原創,除部分有明確署名的作品外,所刊登的所有作品的著作權均為本人所擁有,本人保留所有法定權利。違者必究
對於需要複製、轉載、連結和傳播部落格文章或內容的,請及時和本博主進行聯絡,留言,Email: [email protected]
對於經本博主明確授權和許可使用文章及內容的,使用時請註明文章或內容出處並註明網址