Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem importing FireBase Analytics into Unity

I have a project at Unity 2019.3 with dotnet 4.x. I am trying to import firebase analicts and I have gotten the following error:

System.TypeInitializationException: The type initializer for 'Firebase.Editor.Measurement' threw an exception. ---> System.MissingMethodException: void Google.EditorMeasurement.set_InstallSourceFilename(string) --- End of inner exception stack trace --- at Firebase.Editor.AndroidSettingsChecker..cctor () [0x0000c] in Z:\tmp\tmp.SHkOPK7iEJ\firebase\app\client\unity\editor\src\AndroidAPILevelChecker.cs:37

and

MissingMethodException: void Google.EditorMeasurement.set_InstallSourceFilename(string)

Does anyone have any idea what it could be? Was any library missing? I haven't found reference to this problem anywhere.

like image 256
Mizael Montenegro Avatar asked Mar 25 '20 14:03

Mizael Montenegro


People also ask

How do I get rid of Firebase in Unity project?

After closing Unity, delete all Firebase related folders. Open Unity, it will regenerate some dll's. Close Unity and remove generated files by discarding changes using source control. Repeat open-close Unity and delete generated files.


2 Answers

I had the exact same problem, I fixed it by fully removing the ExternalDependencyManager folder in the project and replaced it using the latest Jar Resolver plugin from here https://github.com/googlesamples/unity-jar-resolver/blob/master/external-dependency-manager-latest.unitypackage

At the same time I also installed Python 2.7 and added it to system path, but I'm pretty sure the jar resolver thing is what fixed the issue. The root problem is the embedded analytics (EditorMeasurement) fail and Firebase never executes the python scripts that make all the Plugins/Firebase/res/values xmls

Hope this helps! :)

like image 102
Rugnor Avatar answered Oct 13 '22 21:10

Rugnor


In my case the issue was happening after adding a new Firebase package with a version bigger than the other Firebase packages already in the project. Updating all the packages to the same version solved the problem.

like image 30
LoDani Avatar answered Oct 13 '22 20:10

LoDani