コガネブログ

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

2023-01-02から1日間の記事一覧

【Unity】AggregateException から FirebaseException を取得する拡張メソッド

ソースコード using System; using System.Linq; using Firebase; namespace Kogane { public static class AggregateExceptionExtensionMethods { public static bool IsFirebaseException( this AggregateException self ) { return self .Flatten() .Inne…

【Unity】FirebaseException の ErrorCode を列挙型に変換する拡張メソッド

ソースコード using Firebase; using Firebase.Auth; namespace Kogane { public static class FirebaseExceptionExtensionMethods { public static AuthError GetAuthError( this FirebaseException self ) { return ( AuthError )self.ErrorCode; } } } 使…

【Unity】Could not create an instance of type org.gradle.initialization.DefaultSettings_Decorated.

概要 Gradle failed to fetch dependencies. Failed to run 'UnityProject\Temp\PlayServicesResolverGradle\gradlew.bat --no-daemon -b "UnityProject\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" "-PANDRO…

【Unity】オフラインの時に FirebaseRemoteConfig.FetchAsync で発生するエラーや例外

概要 Unity エディタ fetching failure: http code 0 FirebaseException iOS FirebaseException: インターネット接続がオフラインのようです。 FirebaseException: Failed to get installations token. Android FirebaseException: The client had an error …

【Unity】fetching failure: http code 400

概要 fetching failure: http code 400 FirebaseException: No Error Message Unity エディタで Firebase の Remote Config の FirebaseRemoteConfig.FetchAsync を実行したら 上記のエラーが発生する現象に遭遇した Unity エディタを再起動したら発生しなく…

【Unity】FirestoreException: Failed to get document because the client is offline.

はじめに using Firebase.Firestore; using UnityEngine; public class Example : MonoBehaviour { private async void Start() { var firestore = FirebaseFirestore.DefaultInstance; var documentReference = firestore .Collection( "users" ) .Document…

【Unity】FirestoreException: Failed to get document from cache.

はじめに using Firebase.Firestore; using UnityEngine; public class Example : MonoBehaviour { private async void Start() { var firestore = FirebaseFirestore.DefaultInstance; var documentReference = firestore .Collection( "users" ) .Document…

【Unity】Firestore の DocumentReference.GetSnapshotAsync はオフラインの場合処理に時間がかかることがある

はじめに using Firebase.Firestore; using UnityEngine; public class Example : MonoBehaviour { private async void Start() { var firestore = FirebaseFirestore.DefaultInstance; var documentReference = firestore .Collection( "users" ) .Document…

【Unity】Firestore の CollectionReference.AddAsync はオフラインの場合 Task が完了しない

概要 using System.Collections.Generic; using Firebase.Firestore; using UnityEngine; public class Example : MonoBehaviour { private async void Start() { var firestore = FirebaseFirestore.DefaultInstance; var collectionReference = firestore …

【Unity】Firestore の DocumentReference.SetAsync はオフラインの場合 Task が完了しない

概要 using System.Collections.Generic; using Firebase.Firestore; using UnityEngine; public class Example : MonoBehaviour { private async void Start() { var firestore = FirebaseFirestore.DefaultInstance; var documentReference = firestore .C…

【Unity】DOTWEEN ► Max Tweens reached: capacity has automatically been increased from 200/50 to 200/125. Use DOTween.SetTweensCapacity to set it manually at startup

概要 DOTWEEN ► Max Tweens reached: capacity has automatically been increased from 200/50 to 200/125. Use DOTween.SetTweensCapacity to set it manually at startup DOTween を使用していて上記の警告が出力された場合は using DG.Tweening; using Un…

【Python】Failed to determine matplotlib's data directory!

概要 Failed to determine matplotlib's data directory! pyinstaller 実行時に上記のエラーが発生する現象に遭遇した pip uninstall pathlib 上記のコマンドで pathlib をアンインストールしたらエラーが発生しなくなった 参考サイト様

【Unity】[Package Manager Window] Cannot perform upm operation: Unable to add package [file:XXXX.tgz]:

概要 [Package Manager Window] Cannot perform upm operation: Unable to add package [file:com.google.firebase.analytics-10.2.0.tgz]: Package com.google.firebase.analytics@file:XXXX\com.google.firebase.analytics-10.2.0.tgz has invalid depende…

【Unity】External Dependency Manager for Unity を導入したら Unity の再生終了時に数秒フリーズするようになった

はじめに External Dependency Manager for Unity を導入したら Unity の再生終了時に数秒フリーズして操作を受け付けなくなった Profiler を見てみたら Unity の再生を終了するたびに Google.RunOnMainThread.ExecuteAll で 2 ~ 3 秒がかかっている状態だっ…

【Unity】Firebase Crashlytics で情報が送信されない場合

概要 using System; using System.Threading.Tasks; using Firebase; using UnityEngine; public class Example : MonoBehaviour { private async void Start() { await FirebaseApp.CheckAndFixDependenciesAsync(); await Task.Delay( 5000 ); throw new E…

【Java】monitor.exe 起動時に「An error has occurred. See the log file XXXX」

はじめに An error has occurred. See the log file XXXX monitor.exe 起動時に上記のエラーが発生して起動できない現象に遭遇した ログファイルには以下のように出力されていた !SESSION XXXX ----------------------------------------------- eclipse.bui…

【Unity】Failed to update Android SDK package list.

はじめに Failed to update Android SDK package list. Android ビルドが正常に動作していた Unity プロジェクトで 急に上記のエラーが発生してビルドができなくなる現象に遭遇した 解決方法 「Preferences > External Tools」を開いて上記の 3 箇所のチェッ…

【Unity】Database URL not set in the Firebase config.

はじめに Database URL not set in the Firebase config. Firebase を導入した Unity プロジェクトを再生する時に 上記の警告ログが出力される現象に遭遇した 解決方法 Assets/StreamingAssets/google-services-desktop.json を開いて { "project_info": { "…

【Unity】[ServicesCore]: To use Unity's dashboard services, you need to link your Unity project to a project ID.

概要 [ServicesCore]: To use Unity's dashboard services, you need to link your Unity project to a project ID. To do this, go to Project Settings to select your organization, select your project and then link a project ID. You also need to m…

【Unity】Compressed texture XXXX is used as icon. This might compromise visual quality of the final image. Uncompressed format might be considered as better import option.

概要 Compressed texture XXXX is used as icon. This might compromise visual quality of the final image. Uncompressed format might be considered as better import option. Android ビルド時に上記の警告ログが出力される現象に遭遇した アイコンに使…

【Unity】There can be only one active Event System.

概要 シーンにアクティブな EventSystem が 2 つ以上存在する場合に There can be only one active Event System. 上記の警告ログが出力される現象に遭遇した EventSystem が 1 つになるようにしたら出力されなくなった

【Unity】シーン遷移後に長押し判定が残ってしまう場合の対処方法

はじめに ボタンを長押ししたらシーン遷移できる機能を実装したところ、 シーン遷移後にも長押し判定が残ってしまい、 指を離した時に遷移後のシーンのボタンが反応してしまう現象に遭遇した Unity エディタでは再現せず、iOS / Android 実機でのみ発生して…

【Unity】File XXXX\.android\repositories.cfg could not be loaded.

概要 File XXXX\.android\repositories.cfg could not be loaded. Android ビルド時に上記の警告が出力される場合、 該当のフォルダに repositories.cfg という名前の空のファイルを作成すると 警告が出力されなくなる

【Unity】Application.backgroundLoadingPriority が反映されない場合

概要 using UnityEngine; public class Example : MonoBehaviour { private void Awake() { Application.backgroundLoadingPriority = ThreadPriority.High; } [RuntimeInitializeOnLoadMethod( RuntimeInitializeLoadType.BeforeSceneLoad )] private stati…

【Unity】Error building Player: Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/res was removed, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of the Manual for more

はじめに Error building Player: Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/res was removed, please move your resources to an AAR or an Android Library. See "AAR plug-ins and Android Libraries" section of th…

【Unity】BetterStreamingAssets: file assets/XXXX is where Streaming Assets are put, but is compressed.

概要 BetterStreamingAssets: file assets/XXXX is where Streaming Assets are put, but is compressed. If this is a App Bundle build, see README.md for a possible workaround. If this file is not a Streaming Asset (has been on purpose by hand o…

【Unity】FirebaseException: This operation is restricted to administrators only.

概要 FirebaseException: This operation is restricted to administrators only. FirebaseAuth で上記のエラーが発生する場合は Firebase Console の「Authentication > Sign-in method」から 使用するプロバイダを追加する必要があります

【Trello】新しいエディタを無効化する方法

概要 Trello の新しいエディタを無効化したい場合は 「フィードバックを送信 > オフに設定」を押します

【Unity】Parent directory must exist before creating asset at Assets/XXXX.

概要 using UnityEditor; using UnityEngine; public class Example { [MenuItem( "Tools/Hoge" )] private static void Hoge() { var material = new Material( Shader.Find( "Specular" ) ); AssetDatabase.CreateAsset( material, "Assets/Hoge/Material.…

【Unity】UnityException: XXXX is not allowed to be called from a MonoBehaviour constructor

概要 UnityException: XXXX is not allowed to be called from a MonoBehaviour constructor (or instance field initializer), call it in Awake or Start instead. Called from MonoBehaviour 'YYYY'. 上記のようなエラーが発生した場合は using UnityEngi…