質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
C#

C#はマルチパラダイムプログラミング言語の1つで、命令形・宣言型・関数型・ジェネリック型・コンポーネント指向・オブジェクティブ指向のプログラミング開発すべてに対応しています。

Unity3D

Unity3Dは、ゲームや対話式の3Dアプリケーション、トレーニングシュミレーション、そして医学的・建築学的な技術を可視化する、商業用の開発プラットフォームです。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

Q&A

1回答

4259閲覧

UnityにFirebaseを導入した際エラーがでる "Unloading broken assembly"

_Beginner

総合スコア103

C#

C#はマルチパラダイムプログラミング言語の1つで、命令形・宣言型・関数型・ジェネリック型・コンポーネント指向・オブジェクティブ指向のプログラミング開発すべてに対応しています。

Unity3D

Unity3Dは、ゲームや対話式の3Dアプリケーション、トレーニングシュミレーション、そして医学的・建築学的な技術を可視化する、商業用の開発プラットフォームです。

Unity

Unityは、Unity Technologiesが開発・販売している、IDEを内蔵するゲームエンジンです。主にC#を用いたプログラミングでコンテンツの開発が可能です。

0グッド

1クリップ

投稿2018/11/28 12:03

編集2018/12/01 22:34

こちらのサイトを参考に、進めていったのですが、
「UnityにSDKを導入する」の部分で、エラーが起きます。

アプリ専用のgoogle-services.jsonをAssetフォルダに貼り付け、
ここからダウンロードしたSDKFirebaseMessaging.unitypackageをインポートしたのですが、エラーが出ます。

Visual StudioやUnityを再起動、Windowsの再起動、SDKの再インポートもやってみましたがエラーが発生し続けます。

Unityのバージョンは2018.1です。もしかしてUnityのバージョンが新しすぎる?


コンソール↓

Unloading broken assembly Assets/Firebase/Plugins/Firebase.App.dll, this assembly can cause crashes in the runtime


Unloading broken assembly Assets/Firebase/Plugins/Firebase.Messaging.dll, this assembly can cause crashes in the runtime


Unloading broken assembly Assets/Firebase/Plugins/Firebase.Platform.dll, this assembly can cause crashes in the runtime


Generation of the Firebase Android resource file google-services.xml from Assets/google-services.json failed.

If you have not included a valid Firebase Android resources in your app it will fail to initialize.
C:/UnityProjects/Test/Assets..\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe -i "Assets/google-services.json" -l.
Microsoft.VC90.CRT.manifest could not be extracted!
You can start to diagnose this issue by executing "C:/UnityProjects/Test/Assets..\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe -i "Assets/google-services.json" -l." from the command line.
UnityEngine.Debug:LogError(Object)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:RunResourceGenerator(String, String, Boolean) (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:508)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:ReadBundleIds(String) (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:369)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:UpdateConfigFileDirectory() (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:261)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:CheckConfiguration() (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:223)
Firebase.Editor.GenerateXmlFromGoogleServicesJson:.cctor() (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:83)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()


c#

1public void Start() { 2 Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived; 3 Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived; 4}

これを追加したいのですが、エラーが原因でOnTokenReceivedOnMessageReceivedの部分でエラーが出ます。


これらはアプリ用にFirebaseで作成したgoogle-services.jsonに問題があるのでしょうか?
どなたか解決法お願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

https://firebase.google.com/docs/unity/setup?hl=ja

に既知の問題として認識されているようですが、こちらでは実験的ビルドの扱いのようですので

UnityのProjectSettingで ScriptingRuntimeVersionが 3.x の場合は

(Firebaseのセットアップ手順に記載されている手順は、Unity 2017でdotnet4フォルダーを使用できることを示しています。これは、スクリプティングバックエンドを4.x(実験的)に設定した場合にのみ当てはまります。)

3.xバックエンドを使い続けたいのなら、dotnet3パッケージを使用してみてはいかがでしょうか?

投稿2019/02/07 02:57

hadchix

総合スコア12

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問