コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】Package Name has not been set up correctly

概要

f:id:baba_s:20220121171612p:plain

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.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Unity でゲームをビルドする時の上記のエラーが発生する場合は

f:id:baba_s:20220121173214p:plain

ダイアログを閉じた後に Inspector に表示される PlayerSettings で
「Company Name」と「Product Name」を

  • 英数字
  • アンダースコア(_
  • 最初の文字は英字

のルールに従って設定するか

f:id:baba_s:20220121173414p:plain

下の方にある「Package Name」に com.CompanyName.ProductName のように
前述のルールに従った文字列を入力することでビルド時にエラーが発生しなくなります