i-school - エラー関連

【エラー】UnityのAsset がインポートできない場合の対処方法


 ダウンロードしたファイルの破損が考えられる。

Windows
C:\Users\%USERNAME%\AppData\Roaming\Unity\Asset Store-5.x

 上記内にある UnityPackage を一度削除して、再度、Asset Store よりダウンロードし直す。
それから Import する。

 AppData フォルダが表示されない場合には、フォルダの設定から隠しファイルの表示を設定する。


【エラー】Unity の再起動で直るエラー


 長時間 Unity を起動していると出始めるエラー。Unity を再起動すると直る。

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Graphs.Edge.WakeUp () (at <810d338ac54a4923957e242981b232ec>:0)
UnityEditor.Graphs.Graph.DoWakeUpEdges (System.Collections.Generic.List`1[T] inEdges, System.Collections.Generic.List`1[T] ok, System.Collections.Generic.List`1[T] error, System.Boolean inEdgesUsedToBeValid) (at <810d338ac54a4923957e242981b232ec>:0)
UnityEditor.Graphs.Graph.WakeUpEdges (System.Boolean clearSlotEdges) (at <810d338ac54a4923957e242981b232ec>:0)
UnityEditor.Graphs.Graph.WakeUp (System.Boolean force) (at <810d338ac54a4923957e242981b232ec>:0)
UnityEditor.Graphs.Graph.WakeUp () (at <810d338ac54a4923957e242981b232ec>:0)
UnityEditor.Graphs.Graph.OnEnable () (at <810d338ac54a4923957e242981b232ec>:0)

参考サイト
ゆーじのUnity開発日記ゆーじのUnity開発日記 様
UnityEditor.Graphs/Edge.cs:114でのエラー
https://unity-yuji.xyz/unityeditor-graphs-edge-cs-...


【エラー】UnityのComputeShader関連のエラー


 Failed to present D3D11 swapchain due to device reset/removed.について

 Windows 側の描画時間のタイムリミットオーバーによる強制終了エラー。
複数のグラフィックボードを利用している場合、BIOS の更新によりいずれかのグラフィックボードの機能が正常に動作しなくなっている。
いずれかのグラフィックボードの利用を停止するか、レジストリを変更することで回避できる。




【エラー】バンドルのファイル破損


参考サイト
コガネブログ 様
【Unity】Addressables でリモートカタログが破損していないか確認する例 - コガネブログ
https://baba-s.hatenablog.com/entry/2022/01/17/090...

 このエラーのときは、バンドルのファイルが破損している可能性あり。
再度 Build して、新しいファイルをクラウドにアップロードする。

groupoperation failed because one of its dependencies failed
remoteproviderexception : unable to load asset bundle from :






 Build したファイルは ServerData フォルダ内にある。





【エラー】NavMeshAgent を Rutime で Bake しようとすると表示されるエラー


 RuntimeNavMeshBuilder: Source mesh xxx does not allow read access.
"This will work in playmode in the editor but not in the player."

 3Dモデルの設定によるエラー。xxx にはモデルの名前が入る。
 
 FBX ファイルを選択して Import Settings を表示し、Read/Write Enable の項目にチェックを入れて Apply することで回避出来る。

 NavMeshComponents を入れて、NavMeshSurface コンポーネントを利用する場合には注意すること。


Unity フォーラム
https://forum.unity.com/threads/runtimenavmeshbuil...


【エラー】シェーダーのエラー


 Shader error in '': Parse error: syntax error, unexpected TVAL_ID, expecting TOK_TRUE or TOK_FALSE or TVAL_VARREF or TVAL_ALPHAMODE at line x

 Line の行でエラーが出ている。

 綴りミス、プロパティや PASS の書式のミスなどが考えられる。



【警告】Unable to find player assembly:

【エラー】Vuforia のビルド時のエラー


  ARMv7 is not compatible with the ARCore version included when using the "Include ARCore Library" option in the VuforiaConfiguration. 
To use an older version of ARCore which supports ARMv7, please include ARCore manually in your project instead.

 Android ビルド時のエラーです。エラーは出力されますが、ビルドには成功します。ただし、ゲームは起動しません。


 ProjectSettings 内の Player → OtherSettings 内にある Identification と Configuration の設定を見直します。

1.Identification の Target API Level を API level 26 以上に設定します。

2.Configuration の Scripting Backend を IL2CPP に設定します。

3.Configuration の Target Architedtures の ARMv7 のチェックを外し、ARM64 のチェックを入れます。

<OtherSettings 内にある Identification と Configuration の設定>



【警告】 Asset bundles built with build target Android may not be compatible with running in the Editor.

Unity Gaming Services の SDK を入れると、Analytics のリンクがないと起動時にエラーで落ちる APK が20メガ位容量が増える。48 → 68メガ

 Addressables の Play Mode Script を Use Existing Build にすると、実機と同じ動きになる(サーバーに取りに行く)
プラットフォーム を Android の設定で Editor で実行すると、上記のように Android 環境ではないことの警告が出る。問題はなし。

 たまに Android で起動画面から Home シーンへ遷移しないことがあるので、
その場合は、再度 Addressables の Build して サーバーへアップしてから Editor で起動できるか試す。
問題なかったら、APK を作成する。

 シーン内に新しいアセット(プレファブ、スプライトなど)を追加した場合、Update では対応できない(Addressables のビルドは通るが起動しない)ので、
Clear してから New Build する。

 すでにあるものを変更した場合には、Update で問題なし。
同じリリースで作れば、Addressables 用のアドレスの変更は不要。


【エラー】Unity Gaming Services の関連性


 詳細は不明だが、Update a Previous Build したサーバーデータだけでは、Android が起動しなくなった。
Home シーンの読み込みに失敗する。
 => 別の日は問題なく動いた(APK も更新なし) シーン内に使われているプレファブのゲームオブジェクトのみ変更。
   スクリプトの変更がないため?
 Editor は特に問題なし。
 Android の場合、Clean Build => New Build して、サーバーに上げてから、APK 作成だと、起動する。

ヒエラルキーに 強制的に Analytics Contenerr が作成される。


【エラー】ContentSizeFitterを使ってネットワークごしに生成すると位置がずれるのは


 更新のタイミングが合わないため(LastUpdateで処理すれば間に合う)

自前でサイズを調整する。


 lblPlayerName.rectTransform.sizeDelta = new Vector2(lblPlayerName.preferredWidth, lblPlayerName.preferredHeight);



【警告】DontDestroyOnLoad only works for root GameObjects or components on root GameObjects.


 ルート階層にないゲームオブジェクトに DontDestroyOnLoad メソッドを利用すると、DontDestroyOnLoad メソッドの機能が働かないため、警告が出る。
つまり、子オブジェクトであるゲームオブジェクトについては、この命令が機能しない。

<警告>
  DontDestroyOnLoad only works for root GameObjects or components on root GameObjects.

Console ビュー



参考サイト
Mono-Materials 様
[Unity] 親要素を持つGameObjectをDontDestroyOnLoadさせる
https://atsushishi.xyz/2017/10/parentoff_to_dontde...



【エラー】ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint Aborting


 EditorWindow の OnGUI() で起こる(ことがある)エラー。
レイアウトの変更(Layout イベントで座標計算後、Repaint イベントで描画を行う際に、座標がずれてしまっている)が発生した際に、エラーとなります。
タイミングとしては、自動レイアウトを利用していると、ボタンの配置変更時などに発生します。

 内部的に発生している場合には、スクリプトの変更が行えないため、Clear で削除するか、エディターを再起動します。


ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint Aborting

 自作しているクラス内に OnGUI メソッドがある場合には、条件分岐を見直すことで回避出来ます。


''ハテナブログ トーフメモ様
【Unity】ArgumentException: Getting control 1's position in a group with only 1 controls when doing repaint が出たときの対処法
''


''Cygames Engineers' Blog様
Cygames Tech Fes フォローアップ: 内製タイムラインツールCuttの紹介
''


【エラー】Broken text PPtr in file

Broken text PPtr in file(Assets/UnityChan2D/Animations/UnityChan2D.controller). Local file identifier (110220483) doesn't exist!

 Unity のバージョンアップを行った際に発生するエラー。
Unity2020.1.19f1 から Unity2021.3.11f1にアップデートしたら発生した。上記の場合は、Console クリアで消える。



 他のものは、発生内容に合わせて修正する必要がある。

参考サイト
コガネブログ様
【Unity】Broken text PPtr in file (XXXX.unity). Local file identifier (YYYY) doesnt exist!


note maruton様
Broken text PPtr. GUID 00000000000000000000000000000000 fileID 8458124308623808283 is invalid! が出たので対処



【警告】A meta data file (.meta) exists but its folder 'XXX' can't be found, and has been created.

 
 XXX の meta ファイルが残っているものの、本体である XXX のデータが見つからないという内容。
A meta data file (.meta) exists but its folder 'Assets/Resources' can't be found, and has been created. Empty directories cannot be stored in version control, so it's assumed that the meta data file is for an empty directory in version control. When moving or deleting folders outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.

 上記の場合、Assets フォルダ内の Resources という名称の meta ファイルはあるが、データが存在していない。
ファイルを移動したり、削除する際には meta ファイルも合わせて移動したり削除するようにすれば解消される。


【警告】There are inconsistent line endings in the 'Assets/[フォルダ名]/XXX.cs' script.



There are inconsistent line endings in the 'Assets/[Scripts]/XXX.cs' script.
Some are Mac OS X (UNIX) and some are Windows.
This might lead to incorrect line numbers in stacktraces and compiler errors.
Many text editors can fix this using Convert Line Endings menu commands.
Assets/[フォルダ名:Scripts]/XXX.cs' スクリプトの改行コードに一貫性がありません。
Mac OS X (UNIX)のものとWindowsのものがあります。
これはスタックトレースの行番号の誤りやコンパイラエラーを引き起こすことがあります。
多くのテキストエディタでは「改行コードの変換」メニューコマンドによりこの問題を修正できます。

 スクリプト・ファイルの内容は Mac OS(UNIX)向けのものとして整形されている(テンプレートとしてそのようになっている)ため、
Windows の環境で、特に Visual Studioを使って編集していると上記の警告が発生することがあります。

 原因としては、スクリプトファイル内に Mac OS X (UNIX)向けの改行文字(LF)と、Windows向けの改行文字(CR + LF)が混在して存在しているときに発生します。

 Visual Studio を再起動するとポッポアップが開いて改行コードの不一致による修正を促されますので、そちらに OK することで修正されます。


参考サイト
Fantastic Works 様
Windows環境のUnityで改行文字不一致の警告が発生する
https://fantastic-works.com/archives/212


【警告】WindowsVideoMedia error unhandled Color Standard:


 VideoPlayer にて 360度動画をインポートしたときと、動画を再生した場合に表示される警告。


<動画インポート時>
WindowsVideoMedia error unhandled Color Standard: 0 falling back to default this may result in rendering issues
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


<動画再生時>
WindowsVideoMedia error unhandled Color Standard: 0 falling back to default this may result in rendering issues

 インポートも行え、動画の再生も可能。


【警告】AudioSampleProvider buffer overflow. XXX sample frames discarded.


 VideoPlayer 再生時の警告。

AudioSampleProvider buffer overflow. XXX sample frames discarded.


【警告】CreateAssetMenu attribute on XXX will be ignored as XXX is not derived from ScriptableObject.


 スクリプタブル・オブジェクト用の XXX クラス作成時の警告。
CreateAssetMenu 属性付与時に、ScriptableObject クラスが継承されていない場合に表示される。

 例えば ImageDataSO クラス作成時には、以下のように表示される
CreateAssetMenu attribute on ImageDataSO will be ignored as ImageDataSO is not derived from ScriptableObject.
UnityEditor.AttributeHelper:ExtractCreateAssetMenuItems (System.Reflection.Assembly)

 
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "ImageDataSO", menuName = "CreateImageData")]
public class ImageDataSO : MonoBehaviour    //  ← ここが警告箇所
{
    public List<ImageData> imageDataList = new();
}

  ↓

using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "ImageDataSO", menuName = "CreateImageData")]
public class ImageDataSO : ScriptableObject   // ← ScriptableObject を継承する
{
    public List<ImageData> imageDataList = new();
}


【Rider 警告】 inconsistent modifiers declaration order.


 Rider での警告の1つです。
inconsistent modifiers declaration order

 メソッドの修飾子などには宣言の順番に指定があり、その通りに直すことで可読性を上げてください、という趣旨の警告です。


https://www.jetbrains.com/help/resharper/ArrangeMo...

    public async virtual UniTask ExecuteAfterEventAsync() {
        Debug.Log("After Event Async");
        await UniTask.Yield();
    }

  ↓

<async と virtual の順番を入れ替えると警告が消える>
    public virtual async UniTask ExecuteAfterEventAsync() {
        Debug.Log("After Event Async");
        await UniTask.Yield();
    }


【警告】WindowsVideoMedia error unhandled Color Standard: 0 falling back to default this may result in rendering issues.


 Unity 側のエラーによる警告です。
ビデオの色の形式についてのものですが、Unity 2022.1 以降のバージョンでは修正済とのこと。

https://issuetracker.unity3d.com/issues/video-wind...


【警告】Unexpected timestamp values detected. This can occur in H.264 videos not encoded with the baseline profile.


 h.264 の画質についての警告。
Main Profile ではなく、Baseline Profile を利用してください、という内容です。

Unexpected timestamp values detected. This can occur in H.264 videos not encoded with the baseline profile.
Timestamps will be skewed to correct the playback for [フォルダ先/XXXX.mp4]


【警告】Some of this projects source files refer to API that has changed.


 Unity 起動時のポップアップウインドウで、スクリプト内の API の自動アップデートのお知らせが出るケース。
Unity のバージョンにより、表示される内容が異なる(こちらは Unity 2021 のもの)


Some of this projects source files refer to API that has changed.
These can be automatically updated.
It is recommended to have a backup of the project before updating.
Do you want these files to be updated?
 
Assets/対象となるスクリプトのディレクトリとファイル名
このプロジェクトのソースファイルの中には、変更されたAPIを参照しているものがあります。
これらは自動的に更新することができます。
アップデートする前に、プロジェクトのバックアップを取ることをお勧めします。
これらのファイルをアップデートしますか?



 用意されている回答は下記の通り。
1,Yes, for these and other files that might be found later
2.Yes, jus for these files
3.No
1.はい、これらのファイルと後で見つかるかもしれない他のファイルに対して行います
2.はい、これらのファイルのみに対して行います
3.いいえ

 1か2を選択すれば自動アップデートが入る。


参考サイト
KITTYPOOL 様
[UNITY]2DRPG開発日誌 #57 FungusでのImport/Export/ローカライズ対応する方法
https://kitty-pool.com/ss057/



【エラー】Kernel 'MultiScaleVODownsample1' not found UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


 MultiScaleVO、Post Processing のシェーダー関連のエラー。2つ一緒に、Unity のバージョンをあげた際に表示されることがある。
このケースでは Unity 2020.1.1f → 2021.3.2f1 にバージョンアップした際に表示された。

<エラー1>
Kernel 'MultiScaleVODownsample1' not found UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

<エラー2>
ArgumentException: Kernel 'MultiScaleVODownsample1' not found.
UnityEngine.Rendering.PostProcessing.MultiScaleVO.PushDownsampleCommands (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Camera camera, System.Nullable`1[T] depthMap, System.Boolean isMSAA) (at Library/PackageCache/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs:290)
UnityEngine.Rendering.PostProcessing.MultiScaleVO.GenerateAOMap (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Camera camera, UnityEngine.Rendering.RenderTargetIdentifier destination, System.Nullable`1[T] depthMap, System.Boolean invert, System.Boolean isMSAA) (at Library/PackageCache/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs:195)
UnityEngine.Rendering.PostProcessing.MultiScaleVO.RenderAfterOpaque (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Library/PackageCache/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/MultiScaleVO.cs:531)
UnityEngine.Rendering.PostProcessing.PostProcessLayer.BuildCommandBuffers () (at Library/PackageCache/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs:599)
UnityEngine.Rendering.PostProcessing.PostProcessLayer.OnPreCull () (at Library/PackageCache/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs:487)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

 下記の動画やフォーラムにあるように、Project Settings の Player → Other Settings → Rendering 内の Auto Graphics API にチェックを入れることで解消できる。




参考サイト
https://www.youtube.com/watch?v=j7MSxQrZ33I
https://issuetracker.unity3d.com/issues/post-proce...
https://forum.unity.com/threads/kernel-errors-afte...


【エラー】ArgumentNullException: Value cannot be null.


 上記の後に Parameter name が続き、エラーの詳細が提示される。
 
ArgumentNullException: Value cannot be null.Parameter name: source

 上記の場合、GetComponent してそのまま取得したコンポーネント内にあるメソッドや変数を利用した際に、GetComponent の戻り値が null になっていて出るエラー。

 このエラーのさらに下に、実際に GetComponent メソッドを実行して取得結果である戻り値の値が null になっている部分が書いてある。
多くはコンポーネントのアタッチミスで取得できていない。該当するゲームオブジェクトにコンポーネントをアタッチすれば改善される。


  AudioSource audioSource;

  [SerializeField]
  AudioClip clip;


  void Start() {
      audioSource = GetComponent<AudioSource>();  //  ← この処理が失敗していて、戻り値が null になっている(実際の原因)
    
      audioSource.PlayOneShot(clip);              //  ← null のままで利用しようとするのでエラーになる(エラー箇所)
  }

 このようにエラーの出ている行と実際にエラーが発生している行が異なるケースが多い。
処理を遡り、しっかりと Debug.Log などを利用して null を見つける必要がある。
エラーの行だけを見ていては、改善できない。


【エラー】UnityEditor.PropertyEditor.DrawEditors (UnityEditor.Editor[] editors) (at <a017e354f3154926a5617fbac3a64fcc>:0)


 Unity エディターのレウアウトのエラー。
新しいアセットをインポート後、エディターを実行したときなどに表示されるエラーのようです。
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.PropertyEditor.DrawEditors (UnityEditor.Editor[] editors) (at <a017e354f3154926a5617fbac3a64fcc>:0)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at <a017e354f3154926a5617fbac3a64fcc>:0)
UnityEditor.InspectorWindow.RedrawFromNative () (at <a017e354f3154926a5617fbac3a64fcc>:0)

 今回のケースでは、DOTweenPro 追加後に表示されました。

 エディタ―のレイアウトの設定を一度、Default に戻すことで解消されます。


参考サイト
わたぶろぐ 様
Unity再生時になんかエラー出るんだけど、その1
電脳産物 様
UnityEditor.InspectorWindowUtils.GetFirstNonImportInspectorEditor…の対処法



【確認】URP Material Upgrade


 プロジェクト内のマテリアルの設定が旧バージョンの URP になっているため、現在のバージョンの Unity の URP に対応した内容に置き換えるというダイアログ。





【エラー】 NullReferenceException: SerializedObject of SerializedProperty has been Disposed.


 Unity 側のエラー。いくつかのバージョンで発生しており、Unity 2022.3.7f1 でも発生。(修正済の報告があるが、まだ直っていない模様)

 Unity エディターを終了し、対象のプロジェクトフォルダ内の Library フォルダを削除して Unity を再起動する。
このときに Library フォルダが再度作成されることで解消される。(再度作り直すため、時間がかかる)

NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.get_intValue () (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.Bindings.ListViewSerializedObjectBinding.UnbindListViewItem (UnityEngine.UIElements.VisualElement ve, System.Int32 index) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEngine.UIElements.ListViewController.UnbindItem (UnityEngine.UIElements.VisualElement element, System.Int32 index) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.CollectionViewController.InvokeUnbindItem (UnityEngine.UIElements.ReusableCollectionItem reusableItem, System.Int32 index) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.VerticalVirtualizationController`1[T].ReleaseItem (System.Int32 activeItemsIndex) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.DynamicHeightVirtualizationController`1[T].ReleaseItem (System.Int32 activeItemsIndex) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.VerticalVirtualizationController`1[T].Refresh (System.Boolean rebuild) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.DynamicHeightVirtualizationController`1[T].Refresh (System.Boolean rebuild) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.BaseVerticalCollectionView.RefreshItems () (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.CollectionViewController.set_itemsSource (System.Collections.IList value) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.BaseVerticalCollectionView.set_itemsSource (System.Collections.IList value) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEditor.UIElements.Bindings.ListViewSerializedObjectBinding.ClearListView () (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.ListViewSerializedObjectBinding.Release () (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.RemoveBinding (UnityEngine.UIElements.IBindable bindable, System.Boolean forceRemove) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.Unbind (UnityEngine.UIElements.VisualElement element) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation.UnbindTree (UnityEngine.UIElements.VisualElement element) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation.Unbind (UnityEngine.UIElements.VisualElement element) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.BindingExtensions.Unbind (UnityEngine.UIElements.VisualElement element) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.PropertyField.Reset (UnityEditor.SerializedProperty newProperty) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.PropertyField.Reset (UnityEditor.UIElements.SerializedPropertyBindEvent evt) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.PropertyField.ExecuteDefaultActionAtTarget (UnityEngine.UIElements.EventBase evt) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetAndDefaultPhase (UnityEngine.UIElements.EventBase evt) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.SendBindingEvent[TEventType] (TEventType evt, UnityEngine.UIElements.VisualElement target) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindPropertyRelative (UnityEngine.UIElements.IBindable field, UnityEditor.SerializedProperty parentProperty) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.Bind (UnityEngine.UIElements.VisualElement element) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.BindingExtensions.Bind (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedObject obj) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.InspectorElement.SetEditor (UnityEditor.Editor value) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.EditorElement.Reinit (System.Int32 editorIndex) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.PropertyEditor.ProcessEditorElementsToRebuild (UnityEditor.Editor[] editors) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.PropertyEditor.DrawEditors (UnityEditor.Editor[] editors) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.PropertyEditor.RebuildContentsContainers () (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.InspectorWindow.RedrawFromNative () (at <97436df440ca462884c5332c1d8ebbe7>:0)

NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.get_objectReferenceInstanceIDValue () (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.EditorGUIUtility.ObjectContent (UnityEngine.Object obj, System.Type type, UnityEditor.SerializedProperty property, UnityEditor.EditorGUI+ObjectFieldValidator validator) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.ObjectField+ObjectFieldDisplay.Update () (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.ObjectField.UpdateDisplay () (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEngine.UIElements.VisualElement+SimpleScheduledItem.PerformTimerUpdate (UnityEngine.UIElements.TimerState state) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.TimerEventScheduler.UpdateScheduledEvents () (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.UpdateSchedulers () (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.UIEventRegistration.UpdateSchedulers () (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEditor.RetainedMode.UpdateSchedulers () (at <f90f2d9cb28d4393afc1338e6af635e0>:0)


参考サイト
ネコニウム研究所 様
【Unity】NullReferenceException: SerializedObject of SerializedProperty has been Disposed.


【ログ】


 エラーではない。2022.3.7f1 にて表示
Multiple ADB server instances found, the following ADB server instance have been terminated due to being run from another SDK. Process paths:
パスの場所



 System.Threading._ThreadPoolWaitCallback:PerformWaitCallback ()



【警告】A meta data file (.meta) exists but its asset 'Assets/Resources/DOTweenSettings.asset' can't be found.

A meta data file (.meta) exists but its asset 'Assets/Resources/DOTweenSettings.asset' can't be found. When moving or deleting files outside of Unity, please ensure that the corresponding .meta file is moved or deleted along with it.



【エラー】ArgumentNullException: Value cannot be null.


 ゲームの実行時に発生。一時停止解除すればそのまま継続は可能。
2022.3.10f でも発生中。

 Unity 再起動で直る。

ArgumentNullException: Value cannot be null.
Parameter name: _unity_self
UnityEditor.SerializedObject.FindProperty (System.String propertyPath) (at <97436df440ca462884c5332c1d8ebbe7>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindPropertyRelative (UnityEngine.UIElements.IBindable field, UnityEditor.SerializedProperty parentProperty) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation+BindingRequest.Bind (UnityEngine.UIElements.VisualElement element) (at <f90f2d9cb28d4393afc1338e6af635e0>:0)
UnityEngine.UIElements.VisualTreeBindingsUpdater.Update () (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.Panel.UpdateBindings () (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.UpdateSchedulers () (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEngine.UIElements.UIEventRegistration.UpdateSchedulers () (at <9d7fc877145d4138982bf12cdd3484c6>:0)
UnityEditor.RetainedMode.UpdateSchedulers () (at <f90f2d9cb28d4393afc1338e6af635e0>:0)


【エラー】UniTask 利用時の DOTween のエラー


 Unity のバージョンを変更した際、ProjectSettings => Other Settings 内の Scripting Define Symbols から UniTask の登録が無くなるため、エラーが出る。

 UNITASK_DOTWEEN_SUPPORT

 こちらを再度追加する。




【エラー】外部アセットのプレハブに別のプレハブをネストしている場合の参照エラー


 外部アセットをバリアントせずに、他のプレハブを子オブジェクトに配置してネストした場合、バージョン変更時にアセット内部での参照が取れずエラーになる。
他にもプレハブを選択したときにエラーが出る。

 ただし、いずれも Console ビューのClear ボタンで消える。

Problem detected while importing the Prefab file: 'Assets/Effects/Fade/TransitionCanvas.prefab'.
The file might be corrupt or have a missing Variant parent or nested Prefabs. See details below.
Errors:
	Nested Prefab problem. Missing Nested Prefab Asset: 'Open_ExitPopUp_Button (Missing Prefab with guid: 473358e0c99939d4fb47f31795a153f7)'

プレハブ ファイル「Assets/Effects/Fade/TransitionCanvas.prefab」のインポート中に問題が検出されました。
ファイルが破損しているか、バリアントの親またはネストされたプレハブが欠落している可能性があります。詳細は以下をご覧ください。
エラー:
ネストされたプレハブの問題。ネストされたプレハブ アセットが見つかりません: 'Open_ExitPopUp_Button (GUID のプレハブがありません: 473358e0c99939d4fb47f31795a153f7)'

 バージョン変更時、外部アセットのプレハブは初期状態でインポートされるので、そこにはネストプレハブを入れておかないようにする。

 また自作のプレハブ自体を単独でプレハブにし、外部アセットについてはバリアントを使って、外部アセットのフォルダ以外の場所に保存しておく


【エラー】SerializedObject target has been destroyed.


 シーン遷移した際に発生する、Unity 側のエラー。Unity 2022.3.7f でも発生する。

 一時停止解除で動く。ライティングや、Material 関係の可能性が高いとのこと。

SerializedObject target has been destroyed.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


参考サイト
UnityでSerializedObject target has been destroyed.が出る場合の対策?(Unity 2019.1、まだ未確定)
https://vinsatoo.hatenablog.com/entry/2019/11/03/1...



【警告】NavMash 関連

 
 2022.2 以前の Unity のバージョンにおいて NavMashComponents アセットを Github からインポートしている場合に表示される警告。

 2022.2 以降は NaveMash の機能が更新され、NavMashComponents で提供していた2D対応も追加されているので、
Assets 内に NavMashComponents アセットが残っている場合には削除する

Cannot add menu item 'GameObject/AI/NavMesh Surface' for method 'Unity.AI.Navigation.Editor.NavMeshSurfaceEditor.CreateNavMeshSurface' because a menu item with the same name already exists.
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler ()

Cannot add menu item 'GameObject/AI/NavMesh Link' for method 'Unity.AI.Navigation.Editor.NavMeshLinkEditor.CreateNavMeshLink' because a menu item with the same name already exists.
UnityEditor.MenuService:GetMenuItemsFromAttributes ()

Cannot add menu item 'GameObject/AI/NavMesh Modifier Volume' for method 'Unity.AI.Navigation.Editor.NavMeshModifierVolumeEditor.CreateNavMeshModifierVolume' because a menu item with the same name already exists.
UnityEditor.MenuService:GetMenuItemsFromAttributes ()


【エラー】InvalidOperationException: Trying to release an object that has already been released to the pool.


 Unity に用意されているオブジェクトプールの機能を利用した際に出るエラーです。

 このエラーは、オブジェクトがすでにオブジェクトプールに返された後に、再び解放しようとしていることを示しています。

InvalidOperationException: Trying to release an object that has already been released to the pool.
UnityEngine.Pool.ObjectPool`1[T].Release (T element) (at <40205bb2cb25478a9cb0f5e54cf11441>:0)
BulletBase.ReleaseBullet (System.Single destroyTime) (at Assets/Scripts/Refactoring/BulletBase.cs:28)

 この例であれば BulletBase クラス内の ReleaseBullet メソッド内においてオブジェクトプールの Release が複数回走っているためです。

 解消法としては、複数の Release を行う可能性のある処理については、フラグ管理を導入することや、
ヒエラルキーにあり、かつアクティブ状態であることを確認するなどの方法が考えられます。

private bool isReleasedToPool = false;

/// <summary>
/// 弾をオブジェクトプールに戻す
/// </summary>
public virtual async void ReleaseBullet(float destroyTime = 0)
{
    await UniTask.Delay(System.TimeSpan.FromSeconds(destroyTime));

    if (!isReleasedToPool) {

        isReleasedToPool = true;
        objectPool.Release(this);

        Debug.Log(objectPool);
    }
}

/// <summary>
/// 初期設定用の仮想メソッド(動作内容を変更できるメソッド。virtual/override)
/// このメソッドをオーバーライドして、特定の型に基づいた初期設定を行うことができる。
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="t">初期設定に使用するジェネリック型のパラメータ。メソッドの実行側で適切な型を指定する。</param>
public virtual void SetUpBullet<T>(T t)
{
    TryGetComponent(out rb);
    isReleasedToPool = false;
}

 例えばこのようにフラグ管理することで適切なオブジェクトプールの管理が行えるようになります。

 ヒエラルキーにあり、かつアクティブ状態であるかで管理したい場合には、if (gameObject.activeInHierarchy) { } 内に戻す処理を書くようにするとよいでしょう。


【エラー】Missing ProjectID


 Build 時に表示される、ProjectID が不一致の場合のエラー。

Because you are not a member of this project this build will not access Unity services.
Do you want to continue?

 Unity 2022 以降であれば Project Settings ウィンドウ内の Services を選択して、新しい ProjectID を取得することでエラー解消される。

 それ以前のバージョンの場合、下記の手順で解消される。

参考サイト
【Unity】「Missing Project ID」のメッセージが出る場合の対処法
https://qiita.com/nonkapibara/items/808834465b6d01...


【エラー】Conflict


 ブランチの Head の位置が Develop をマージしたブランチよりも古いと、差分のあるクラスにおいてコンフリクトが発生します。
ブランチに Develop 更新情報をマージし、最新の状態にして作業しましょう。

https://docs.unity3d.com/2022.3/Documentation/Manu...


【確認メッセージ】Fungus インポート時のエラー


 Fungus の UnityPackage を利用してインポートを行うと、下記の確認メッセージが表示されます。





<Script Updating Consent>
Some of this projects source files refer to API that has changed. 
These can be automatically updated. 
It is recommended to have a backup of the project before updating. 
Do you want these files to be updated?

Assets/Fungus/Scripts/Commands/Property/AnimatorProperty.cs
Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs
Assets/Fungus/Scripts/Editor/ViewEditor.cs

<和訳>
このプロジェクトのソースファイルの一部は、変更されたAPIを参照しています。
これらは自動的に更新される可能性があります。
更新する前にプロジェクトのバックアップを取ることをお勧めします。
これらのファイルを更新しますか?

 このメッセージは、プロジェクトの一部のファイルが古いAPIを参照している可能性があるため、そのファイルを更新するかどうかを尋ねています。
更新する場合、プロジェクトのバックアップを取ることが推奨されています。

 次に示されている選択肢の意味は次の通りです。

「Yes, for these and other files that might be found later.」 - はい、これらのファイルだけでなく、今後見つかるかもしれない他のファイルも更新します。
「yes, just for these files.」 - はい、これらのファイルのみを更新します。
「No」 - いいえ、更新しません。

 選択肢の違いは、更新の対象となるファイルの範囲です。
1番目の選択肢では、今後見つかるかもしれない他のファイルも含めて更新されます。
2番目の選択肢では、これらの特定のファイルのみが更新されます。
3番目の選択肢では、どのファイルも更新されません。

 基本的には一番左の「Yes, for these and other files that might be found later.」を選択しておくとよいでしょう。


【エラー】Fungus インポート後のエラー


 下記のエラーは Fungus インポート後に Unity エディターの Console ビューに表示されるエラーです。
Console ビューの Clear ボタンで解消されます。

Unable to import newly created asset : Assets/Fungus/EditorResources/FungusEditorResources.asset
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Fungus.EditorUtils.FungusEditorResources:get_Instance () (at Assets/Fungus/Scripts/Editor/FungusEditorResources.cs:95)
Fungus.EditorUtils.FungusEditorResources:OnDidReloadScripts () (at Assets/Fungus/Scripts/Editor/FungusEditorResources.cs:184)

Exception thrown while invoking [DidReloadScripts] method 'Fungus.EditorUtils.FungusEditorResources:OnDidReloadScripts ()' :
UnityException: Creating asset at path Assets/Fungus/EditorResources/FungusEditorResources.asset failed.
Fungus.EditorUtils.FungusEditorResources.get_Instance () (at Assets/Fungus/Scripts/Editor/FungusEditorResources.cs:95)
Fungus.EditorUtils.FungusEditorResources.OnDidReloadScripts () (at Assets/Fungus/Scripts/Editor/FungusEditorResources.cs:184)



 あるいは以下のエラーが表示されます。
こちらも Console ビューの Clear ボタンで解消されます。



Errors during import of AudioClip Assets/FungusExamples/TheHunter/Audio/Music.mp3:
FSBTool ERROR: Internal error from FMOD sub-system.
FSBTool ERROR: Internal error from FMOD sub-system.

Errors during import of AudioClip Assets/FungusExamples/JumpingPrax/Music/PraxMusic.mp3:
FSBTool ERROR: Internal error from FMOD sub-system.
FSBTool ERROR: Internal error from FMOD sub-system.

Errors during import of AudioClip Assets/FungusExamples/TheFacility/Music/CKZ_-_09_-_Youre_Not_Real.mp3:
FSBTool ERROR: Internal error from FMOD sub-system.
FSBTool ERROR: Internal error from FMOD sub-system.



【エラー】XCode


 iOS デバイス側での設定を見直すことでエラーが解消され、Unity が起動します。