I am using Unity 2021.3.11f1 to implement Firebase 10.3.0 Analytics + Crashlytics for an Android Game.
After a few tests without anything showing up in the Google Dashboard, I figured something was wrong with the Firebase initializing.
As soon as I launch the game on my Android device, this is one of the first things seen in logcat:
01-05 15:51:45.078 32211 2657 E Unity : DllNotFoundException: Unable to load DLL 'FirebaseCppApp-10_3_0'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-10_3_0' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-10_3_0" not found
01-05 15:51:45.078 32211 2657 E Unity : at Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil (Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate applicationDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate arithmeticDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate divideByZeroDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate indexOutOfRangeDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate invalidCastDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate invalidOperationDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate ioDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+E
Here is what my Android Libraries with dependencies looks like:
(NB: At this point I tried installing Firebase 9.6.0 instead, that's why it doesn't say 10.3.0 here)
([rootProject] + (rootProject.subprojects as List)).each { project ->
project.repositories {
def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
maven {
url "https://maven.google.com"
}
maven {
url (unityProjectPath + "/Assets/Firebase/m2repository") // Assets/Firebase/Editor/AnalyticsDependencies.xml:18, Assets/Firebase/Editor/AppDependencies.xml:22, Assets/Firebase/Editor/CrashlyticsDependencies.xml:20
}
mavenLocal()
mavenCentral()
}
}
dependencies {
implementation 'com.google.android.gms:play-services-base:18.1.0' // Assets/Firebase/Editor/AppDependencies.xml:17
implementation 'com.google.android.play:asset-delivery:2.0.0' // Assets/GooglePlayPlugins/com.google.play.assetdelivery/Editor/Dependencies.xml:3
implementation 'com.google.android.play:core-common:2.0.0' // Assets/GooglePlayPlugins/com.google.play.core/Editor/Dependencies.xml:3
implementation 'com.google.firebase:firebase-analytics:21.1.1' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:15
implementation 'com.google.firebase:firebase-analytics-unity:9.6.0' // Assets/Firebase/Editor/AnalyticsDependencies.xml:18
implementation 'com.google.firebase:firebase-app-unity:9.6.0' // Assets/Firebase/Editor/AppDependencies.xml:22
implementation 'com.google.firebase:firebase-common:20.1.2' // Assets/Firebase/Editor/AppDependencies.xml:13
implementation 'com.google.firebase:firebase-crashlytics-ndk:18.2.13' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:13
implementation 'com.google.firebase:firebase-crashlytics-unity:9.6.0' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:20
}
android {
packagingOptions {
exclude ('/lib/armeabi/*' + '*')
exclude ('/lib/armeabi-v7a/*' + '*')
exclude ('/lib/mips/*' + '*')
exclude ('/lib/mips64/*' + '*')
exclude ('/lib/x86/*' + '*')
exclude ('/lib/x86_64/*' + '*')
}
I run the usual 'CheckAndFixDependencies' and do not get any errors during this. I've also managed to get this working before in another project without problems, but no matter what I do it seems like the 'Core' app of firebase won't start due to not being able to find the DLL.
I tried both Firebase SDK 10.3.0 and 9.6.0 with the same results.
When I find the DLL that it claims to be missing in Unity (Assets/Firebase/Plugins/x86_64/FirebaseCppApp-9_6_0.dll) it stands as being included in every platform, Editor as well as standalone.
I've forced countless amounts of dependency resolves, without luck.
I tried disabling the target architecture ARMv7 (Because I saw someone suggesting it in another post about this). No help either unfortunately.
I'm currently testing with apk so I don't have to work through aab atm, but I really doubt that should cause Firebase issues.
Am I missing something extremely obvious / being blind here?
I have the same issue. I will try many tries but it isn't work.
At the end of the second day, I have tried create a new empty project and add it from
https://developers.google.com/unity/archive#firebase_app_core
in package manager as tarball tgz files:
external dependency tgz
firebase app (core) tgz
for me its firebase analytics for you its another firebase tgz
Those tgz must be the same version in my case first install 10.3 it isn't work.
Second i download 9.6 tgz files. And it's working.
But I have a new error in the console: Database URL not set in the Firebase config.
It's solved in firebase account you need to create realtime database, and downloaded the new google-services.json. Then in Unity remove old google-services.json and clean Assets\StreamingAssets folder. Import new google-services.json. And it worked.
Then I tried in my work project. I remove all firebase sdk folders and did the same. And its works fine!
Related
So, I created an app with firebase authorization (Google Sign In), and I got it working perfectly. Now, I needed to import Firestore package, so I did it, tried my app once again after importing, and suddenly, my app gets stuck on following code (the code is from authorization, and was working before importing a new SDK package):
Firebase.Auth.Credential credential = Firebase.Auth.GoogleAuthProvider.GetCredential(idToken: idToken1, accessToken: null);
It just executes this line of code and never finishes! I still get GoogleID token, but it just gets stuck on that line of code. There are some errors in logcat but I don't know if it affects my app:
Error Not starting debugger since the process cannot load the jdwp agent.
Error libprocessgroup set_timerslack_ns write failed: Operation not permitted
I've updated google-services.json file after creating the database.
I am using Unity 2021.3.2f1, Firebase 9.0 SDK, tried with the latest version of sdk and still getting the same results.
I searched about this, but couldn't find anything useful. If anyone has any idea what I need to do to fix this, please help. Thanks
I an trying to use the speech SDK in blazor webasm app, but with recurring problem of missing "Microsoft.CognitiveServices.Speech.core.dll".
There are a few reports about this issue, but not single one relating to webasm app.
Steps to reproduce the problem:
new blazor webasm project in VS2019
sc1
sc2
Install Speech SDK package
sc3
Update Index.Razor with minimum code to reproduce
#page "/"
#using Microsoft.CognitiveServices.Speech;
<h1>Bug Reproduction</h1>
#code {
private static readonly string SpeechSubscriptionKey = "somevalidkey";
private static readonly string SpeechLocation = "somelocation";
private SpeechConfig _SpeechConfig;
protected override async Task OnInitializedAsync()
{
_SpeechConfig = SpeechConfig.FromSubscription(SpeechSubscriptionKey, SpeechLocation);
}
}
sc4
Now, when build and run (no matter debug/release, clean/rebuild, publish etc.) will get you the console output:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Microsoft.CognitiveServices.Speech.core.dll
System.DllNotFoundException: Microsoft.CognitiveServices.Speech.core.dll
at Microsoft.CognitiveServices.Speech.SpeechConfig.FromSubscription(String subscriptionKey, String region)
The app page in the chrome opens, but the resource is indeed missing:
sc5
As I mentioned, I found several reports about bugs related to this issue, but none of webasm target.
The only resolution I found mentioned was to manually copy the Microsoft.CognitiveServices.Speech.core.dll to the target directory.
I am not quite sure how to do that correctly for webasm project, as I am new to it (as well as to .net as a whole).
As an act of desperate man, I tried copying Microsoft.CognitiveServices.Speech.core.dll to the folder \bin\Debug\net5.0\wwwroot_framework\ and updating blazor.boot.json. The dll will then appear in blazor-resources in chrome, but the error message is the same. (System.DllNotFoundException).
The problem is that I have no idea which of the Microsoft.CognitiveServices.Speech.core.dll files I can find in nuget\packages\microsoft.cognitiveservices.speech\1.14.0\ folder could work, if any.
I may be missing something important here, any help or explanation what goes on would be greatly appreciated.
It turned out that WASM target is not yet supported. Js-sdk is the option for the time being. github issue
I've been a developer Unity iOS developer for a while now and I recently tried to test out my app on my phone. After building the project and uploading it to xCode so I can upload the app on my phone, the app was developed but crashes once I opened it. There are some warning logs but not sure which one is causing the crashing.
https://i.stack.imgur.com/FKY8e.jpg
https://i.stack.imgur.com/D4ryX.png
I also might think this is because I am not paying for the Apple developer program, yet before I was able to test it without paying for it.
Logs:
2020-03-28 14:11:21.207192-0700 TheSuccFinal[2733:973093] Error loading /var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework: dlopen(/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework, 265): no suitable image found. Did find:
/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework: code signature invalid for '/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework'
/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework: stat() failed with errno=3
/private/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework: code signature invalid for '/private/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework'
2020-03-28 14:11:21.247919-0700 TheSuccFinal[2733:973093] Error loading /var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework: dlopen(/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework, 265): no suitable image found. Did find:
/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework: code signature invalid for '/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework'
/private/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework.framework/UnityFramework: code signature invalid for '/private/var/containers/Bundle/Application/A8DD7379-FF01-4A00-AF26-77A546A87C8E/TheSuccFinal.app/Frameworks/UnityFramework
It is related to iOS 13.3.1 since recent releases from Apple iOS builder, personal (non-developer) Apple accounts cannot sign frameworks correctly, since Unity is a framework itself it is not signed when built.
You can check this unity forum discussion and this discussion in the flutter framework about the bug.
Apparently it is fixed in iOS 13.4, so check your XCode version, iOS target version and you should be good to go.
I am using Firebase package in Unity. It works perfectly fine when I run the game in the Unity editor, however, when I build the game for Android, I get this error:
Failed to read firebase options from the app's resources either make
sure google-services.json is included in your build or specify options
directly
I already have google-services.json file in the Assets folder and I added the following block of code as suggested here (https://firebase.google.com/docs/unity/setup):
private void ConfirmGooglePlayerServicesRequirements()
{
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
var dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available)
{
// Create and hold a reference to your FirebaseApp,
// where app is a Firebase.FirebaseApp property of your application class.
app = Firebase.FirebaseApp.DefaultInstance;
// Set a flag here to indicate whether Firebase is ready to use by your app.
firebaseIsReadyToBeUsed = true;
}
else
{
Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
// Firebase Unity SDK is not safe to use here.
}
});
}
Thanks!
This solved it for me, 2020 version, see here:
In order to support versions of Unity that do not have the ability to customize the Gradle build, the Firebase editor tool generates Assets/Plugins/Android/Firebase/res/values/google-services.xml as an Android resource to be packaged into an Android build, so that the Firebase SDK can use it to initialize the default FirebaseApp instance.
In Unity 2020, all Android resources must be in directories with a .androidlib suffix. If your project is using a Firebase SDK that generates an Assets/Plugins/Android/Firebase directory, rename it to Assets/Plugins/Android/Firebase.androidlib. Make sure it contains AndroidManifest.xml, project.properties and res/values/google-services.xml.
Source: https://firebase.google.com/docs/unity/setup#missing_firebase_android_config_file_in_unity_2020
In your mainTemplate file you need to add this at the bottom
android {
sourceSets {
main {
def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
res.srcDirs += (unityProjectPath + '/Assets/Plugins/Android/Firebase/res/values/google-services.xml')
}
}
I have web service that writing in C# , and host in azure .
As part of my processing I want to use the fire-base admin via my C# code.
After I looking in the web I found the edge.js package that let you to run node.js scripts under C# , I install the package and success to run different node.js scripts via C# .
The problem start when I try to use the firebase admin SDK .
I install the firebase lib via npm (npm install firebase-admin -g) as global package.
Then I try to use it for calling the firebase lib , I try only to load the lib and I received error.
var func = Edge.Func(#"
return function(data,callback)
{
var admin = require('firebase - admin');
callback(null, 'test fcm ' + data);
}
");
The error I received in c# is :
An unhandled exception of type 'System.AggregateException' occurred in
mscorlib.dll
So I have several question :
1. May someone success to work with the fire-base lib via edge.js ?
How I can debug the error ?
May someone have different method for calling the firebase admin nodejs sdk via C# ?
May someone have any method for calling the firebase admin via C# code ?
Thanks ,
MAK
To avoid this error, you'd need to run the command npm install firebase-admin in the root of your c# project, it will install the dependencies in the node_modules folder for your project.
You also need to remove spaces from the package name as below:
var admin = require('firebase-admin');