简体   繁体   中英

Unity - DllNotFoundException: Unable to load DLL 'FirebaseCppApp-10_2_0'. on android build

I am using unity engine with firebase and I am trying to do a build for android, it does work but the firebase functions are not and I get this errors: (on the editor its working fine)

`

AndroidPlayer "samsung_SM-G988N" DllNotFoundException: Unable to load DLL 'FirebaseCppApp-10_2_0'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-10_2_0' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-10_2_0" not found
  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+ExceptionDelegate nullReferenceDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate outOfMemoryDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate overflowDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate systemExceptionDelegate) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Database.FirebaseDatabase.get_DefaultInstance () [0x00000] in <00000000000000000000000000000000>:0 
  at MultiPlayerMenu.Start () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE.SWIGExceptionHelper' threw an exception.
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Database.FirebaseDatabase.get_DefaultInstance () [0x00000] in <00000000000000000000000000000000>:0 
  at MultiPlayerMenu.Start () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception.
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Database.FirebaseDatabase.get_DefaultInstance () [0x00000] in <00000000000000000000000000000000>:0 
  at MultiPlayerMenu.Start () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception.
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Database.FirebaseDatabase.get_DefaultInstance () [0x00000] in <00000000000000000000000000000000>:0 
  at MultiPlayerMenu.Start () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.
  at Firebase.Database.FirebaseDatabase.get_DefaultInstance () [0x00000] in <00000000000000000000000000000000>:0 
  at MultiPlayerMenu.Start () [0x00000] in <00000000000000000000000000000000>:0 



`

For now I tried to remove unity library and it did nothing I tried to change to IL2CPP and toggle arm64 and it did nothing when I try android force resolve it will fail and I get this:

`

Resolution failed

Failed to fetch the following dependencies:
com.google.firebase:firebase-app-unity:+
com.google.firebase:firebase-auth-unity:+
com.google.firebase:firebase-database-unity:+


UnityEngine.Debug:LogError (object)
Google.Logger:Log (string,Google.LogLevel) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/Logger.cs:136)
GooglePlayServices.PlayServicesResolver:Log (string,Google.LogLevel) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:1069)
GooglePlayServices.GradleResolver:LogMissingDependenciesError (System.Collections.Generic.List`1<string>) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:95)
GooglePlayServices.GradleResolver/<DoResolutionUnsafe>c__AnonStorey18:<>m__22 (System.Collections.Generic.List`1<Google.JarResolver.Dependency>) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:920)
GooglePlayServices.GradleResolver/<GradleResolution>c__AnonStorey11:<>m__17 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:383)
GooglePlayServices.GradleResolver/<GradleResolution>c__AnonStorey11:<>m__27 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:448)
GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStorey1B:<>m__24 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:1123)
Google.RunOnMainThread:ExecutePollingJobs () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
Google.RunOnMainThread:<ExecuteAllUnnested>m__12 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
Google.RunOnMainThread:RunAction (System.Action) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested (bool) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:PollOnUpdateUntilComplete (System.Func`1<bool>,bool) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:379)
GooglePlayServices.PlayServicesResolver:LabelAssets (System.Collections.Generic.IEnumerable`1<string>,System.Action`1<System.Collections.Generic.HashSet`1<string>>,bool,System.Action`2<single, string>,bool,bool) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2374)
GooglePlayServices.GradleResolver:ProcessAar (string) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:1425)
GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStorey1B:<>m__24 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:1093)
Google.RunOnMainThread:ExecutePollingJobs () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
Google.RunOnMainThread:<ExecuteAllUnnested>m__12 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
Google.RunOnMainThread:RunAction (System.Action) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested (bool) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:PollOnUpdateUntilComplete (System.Func`1<bool>,bool) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:379)
GooglePlayServices.PlayServicesResolver:LabelAssets (System.Collections.Generic.IEnumerable`1<string>,System.Action`1<System.Collections.Generic.HashSet`1<string>>,bool,System.Action`2<single, string>,bool,bool) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/PlayServicesResolver.cs:2374)
GooglePlayServices.GradleResolver:ProcessAar (string) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:1425)
GooglePlayServices.GradleResolver/<ProcessAars>c__AnonStorey1B:<>m__24 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/AndroidResolver/src/GradleResolver.cs:1093)
Google.RunOnMainThread:ExecutePollingJobs () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:409)
Google.RunOnMainThread:<ExecuteAllUnnested>m__12 () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:541)
Google.RunOnMainThread:RunAction (System.Action) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:343)
Google.RunOnMainThread:ExecuteAllUnnested (bool) (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:530)
Google.RunOnMainThread:ExecuteAll () (at /Users/drsanta/dev/tmp/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:512)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
`

What should I do? I impoted only the firebase database

Yeah, I have caught this problem too, and need to manually add Firebase App (Core) package, which should be dependency but seem like its not. This could happen if you mix different versions of the libraries. Can you verify that all the Firebase libraries you're using are the same version? The issue is that there is no way to specify exact dependency version for Unity Package Manager unfortunately. The version number used in package manifest is more like the min version unless the major version is changed. That is why we documented this at the bottom of this section

There might be something we can do in the EDM4U side to fill this void. It will take some time to develop since it changes not only EDM4U, but also the metadata from registry server and the release process.

Until then, please make sure not only Firebase packages are in the same version, but also Firebase App (Core), which installed as a dependency, is in the same version as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM