Quickstart-unity: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-5.5.0': The specified module could not be found.

Created on 5 Mar 2019  路  38Comments  路  Source: firebase/quickstart-unity

Please fill in the following fields:

Unity editor version: Unity 2018.3.7f
Firebase Unity SDK version: 5.5.0
Additional SDKs you are using (Facebook, AdMob, etc.):
Platform you are using the Unity editor on (Mac, Windows, or Linux): OSX
Platform you are targeting (iOS, Android, and/or desktop): Android

Please describe the issue here:

imported new project with 5.5 version of Firebase getting this error if i have iL2Cpp + all target architectures checked. scripting backend is .Net 4.x Api Compatibility level .Net 4.x

bug

All 38 comments

We've seen this problem in the past when developers delete files that the Firebase plugin requires. Is is possible some files got delete by mistake? Does the problem persist if you do a clean install of the plugin?Can you reproduce this error on a clean copy of the Unity quickstart testapp?

@alexames I have the same problem.
I found this issue when I selected ARM64 in Target Architectures for 64-bit support.

Could you provide any update or workaround?

===== exception log =====
03-09 18:29:41.172 26489 26516 E Unity : DllNotFoundException: Unable to load DLL 'FirebaseCppApp-5.5.0': The specified module could not be found.
03-09 18:29:41.172 26489 26516 E Unity : at Firebase.AppUtilPINVOKE.PollCallbacks () [0x00000] in :0
03-09 18:29:41.172 26489 26516 E Unity : at Firebase.AppUtil.PollCallbacks () [0x00000] in :0
03-09 18:29:41.172 26489 26516 E Unity : at Firebase.Platform.FirebaseHandler.Update () [0x00000] in :0

Was having this issue and followed @alexames suggestion of reinstalling the firebase plugin. After that i had to regenerate the facebook manifest and it worked as expected.

@Rolos I changed the Unity version from Unity 2017 to Unity 2018.2.21f, and it works well. Thank you. :)

hey guys so i did not deleted anything after researching and changing lots of things found out that each time you change back-end from 3.5 to 4.x or even api level you need to make force resolve of dependencies idk why but after forcing it twice it works just great. now my app runs on all architects with iL2CPP + 2018.3.7 + Net 4.x. thanks for info maybe this will help others too :)

Unity Editor Version: 2018.3.8f1
Firebase 5.5.0
Admob 3.15
Google Play Service 0.9.62
OS: macOS High Sierra 10.13.6
Target Platform: Android

hello guys I have struggling the same issues and searching a solution for a week already. Firebase threw an exception DllNotFound. My setup firebase sdk 5.5.0 adman 3.15. and google play services treid man thing but nothing helps. Could any one help?

https://i.imgur.com/JWuxnhQ.jpg
this is my settings i am using latest google play,admob,facebook and all kind of other sdk + Resolver is v1.2.102.0. just double check everything. delete firabase,delete all imported .aar files from resolver and use force resolve from play services :) to ensure do it 2-3 times. that helped me :)

@WTF-Grinch :) I delete all files and reimported it my resolver is also v1.2.102.0 but the problem is still there! I did it 4 times :D

@ctykaya are the settings the same as image i show ? lets open x86_64 folder and see if all files have this settings :) https://imgur.com/kWLXRhb

I cannot open your image file browser give and error say one file found
https://ibb.co/FX58yD1 my x86_64 have these files
All files checked Editor and standalone
I reset unity and the problem SOLVED 馃憤

you just need to copy/paste image link but anyway good to here that its working :)

@ctykaya what did you actually reset in unity to make it work? have the same issue

@johnsergeyev I quit it and restart the unity again. When you change plugin by script or resolve should restart unity.

@ctykaya doesn't work in my case, i've force resolved twice, restarted unity -> still having same error =/

Editor Unity 2018.2.14f1
Firebase Unity SDK: 5.4.0 and 5.5.0
Publication on platform Android

1) Usually "force resolve" fixes the problem but not this time.
2) I tried to remove all folders of Firebase, restarted Unity and install 5.4.0 but no success
3) Move git back to last successful release same problem, compile, execute and then error
4) Delete everything within project except Assets so Unity gets reset no success
5) Tried add Firebase analytics to old dummy project SUCCESS
6) Then created new project and added Firebase analytics (planing to move everything step by step) again NO success (magic?)
7) Test dummy project again and it works FirebaseApp.CheckAndFixDependenciesAsync successfully executed...
8) Compared dummy project and new not working project, result: all Firebase SDK related folders have same amount of files and even size is same (including last byte).

The only difference between dummy and new project was that I imported Analytics, RemoteConfig and Instance at the same time in new project, while in old dummy project I imported ONLY Analytics. Tomorrow I will give a try to create empty project and import only Analytics.

This bug looks very strange to me, I wasted over 48 hours trying to fix it. I should mention that I am successfully using Firebase SDK with all three services mentioned above for more than a year. The issue started at the beaning of March (when I tried to resolve the issue after importing changes from master to release branch, which I usually do, otherwise Firebase SDK may stop working, app will run but if you run app in developer mode then you will see lots of none stop error messages about missing something). Thanks

17140-17140/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x417e8da0)
17140-17140/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.app.name.here, PID: 17140
java.lang.NoClassDefFoundError: com.google.android.gms.common.R$string
at com.google.android.gms.common.internal.StringResourceValueReader.(Unknown Source)
at com.google.firebase.FirebaseOptions.fromResource(com.google.firebase:firebase-common@@16.0.2:160)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.2:301)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@16.0.2:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@16.0.2:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:5253)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4847)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4730)
at android.app.ActivityThread.access$1600(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)

Unity editor version: Unity 2017.4.22f
Firebase Unity SDK version: 5.5.0
Extra Sdks: Facebook SDK: 7.15.1, Mopub SDK:
Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows
Platform you are targeting (iOS, Android, and/or desktop): Android
Scripting Backend: IL2CPP
Runtime Version: .net 3.5

This is so sad. Thanks to this bug, our 64 bit builds don't work anymore. Keep throwing this exception. Did delete and re-install sdk's several times. Reset unity, resolve, force resolve, no luck.

I'm glad at least I could successfully make a 32 bit build which works.

ps: As it says in the importing settings, I deleted .net 4.0 dll's in Parse directory.

SOLUTION for my case, here is the magic spell:

Close Unity; RENAME project folder; Start Unity; Open project from new folder; Enjoy

Seems like Unity itself caches something because I tried deleting everything except asset folder and it did not help. Luckily I had old dummy project where Firebase SDK worked. Unfortunately (or may be fortunately) the name for new empty test project (where Firebase SDK magically stopped working again) I selected the same as old one (which had issue) because I was planing to move assets manually.

So then I simply copy working dummy project and name it same as project with issue and it stopped working while under old folder name it was working fine. So it was obvious that issue is in folder name. I hope it will help someone too

p.s. also seems like downgrade to 5.4.0 is also important, as with 5.5.0 I was getting new error DexArchiveMergerException: Unable to merge dex

I've just upgraded to 5.6.0, still getting the same error with the new version
"DllNotFoundException: Unable to load DLL 'FirebaseCppApp-5.6.0': The specified module could not be found."

We are using
Unity editor version: Unity 2017.4.23
Firebase Unity SDK version: 5.4.4
Platform: Mac
Targeting: Android

Logcat is getting spammed with this Error on Android: E/Unity: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-5.4.4': The specified module could not be found.
seems to be similar to issues mentioned in the thread. I've tried reimporting firebase, running resolver, same project to a different folder.
Still occurring. Not sure if anyone has any other ideas or suggestions?

When the Android Jar Resolver runs, it should be packaging up the aars that contains the library that you all are missing. If you look in the directory Assets > Plugins > Android, there should be a folder or an aar called com.google.firebase.firebase-app-unity-5.6.0 (or whatever version you are using). In that folder (if it is an aar, you can unzip it), there should be libs > armeabi-v7a > libFirebaseCppApp-5.6.0.so.

If that is missing, that means that something has gone wrong with the Android Jar Resolver. If that is there, that would mean that it is failing to include that aar for some reason.

Thank you @a-maurice I will investigate this.

When the Android Jar Resolver runs, it should be packaging up the aars that contains the library that you all are missing. If you look in the directory Assets > Plugins > Android, there should be a folder or an aar called com.google.firebase.firebase-app-unity-5.6.0 (or whatever version you are using). In that folder (if it is an aar, you can unzip it), there should be libs > armeabi-v7a > libFirebaseCppApp-5.6.0.so.

If that is missing, that means that something has gone wrong with the Android Jar Resolver. If that is there, that would mean that it is failing to include that aar for some reason.

I've checked mine, the only file under libs>armeabi-v7a is "libFirebaseCppAnalytics.so" , there is no libFirebaseCppApp-5.6.0.so ... But somehow our 32 bit builds are working, not throwing any exception. We are having problem with 64 bit builds.

@ttesla, that's definitely interesting. If you look in the directory Assets > Firebase > Editor, do you have an AppDependencies.xml. And in that it should have an androidPackage tag, with spec="com.google.firebase:firebase-app-unity:5.6.0". Also, if you look in the directory Assets > Firebase > m2repository > com > google > firebase, you should have firebase-app-unity > 5.6.0 folders, with a srcaar and pom file.

Assuming all of those are there, my next suggestion would be turning on verbose logging in the Android resolver. To do so, from the toolbar go Assets > Play Services Resolver > Android Resolver > Settings, one of the options is Verbose Logging. You can turn that on, and then from the Android Resolver toolbar select Force Resolve. The log will be a lot spammier, but it might indicate why it is failing to build the one for app.

Cmon anyone !
DllNotFoundException: Unable to load DLL 'FirebaseCppApp-5.6.0': The specified module could not be found.
Firebase.AppUtilPINVOKE.PollCallbacks () (at <00000000000000000000000000000000>:0)
Firebase.AppUtil.PollCallbacks () (at <00000000000000000000000000000000>:0)
Firebase.Platform.FirebaseHandler.Update () (at <00000000000000000000000000000000>:0)

got 9.6 Million errors in Unity Dashboard 馃憥 fucks sake some one fix this !!!!!!
worked on local devices when testing locally uploaded to google bang here it comes :(

-Deleted my com.google.firebase.firebase-app-unity-5.4.4
-Ran the resolver (no errors and it re-added that file)
-Checked inside and found it does have libs > armeabi-v7a > libFirebaseCppApp-5.4.4.so and for x86
-No versions for ARM64 (Maybe that's the issue??)
-Build for Arm64 and when running output is still spamming the error: E/Unity: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-5.4.4': The specified module could not be found.
@a-maurice any other ideas? Thanks for your help.

Can you confirm that if you open up the Player Settings..., under the Android tab, Configuration, that ARM64 is checked.

It is a two part process for determining the ABI's that get included in the generated aars. First, it determines what is available based on the Unity version, https://github.com/googlesamples/unity-jar-resolver/blob/master/source/PlayServicesResolver/src/AndroidAbis.cs#L103. Then, after it has generated the libraries, it removed any that are not being used: https://github.com/googlesamples/unity-jar-resolver/blob/master/source/PlayServicesResolver/src/DefaultResolver.cs#L328. If you could share any verbose logs, which I described how to enable previously, we can see if it mentions removing versions that it shouldn't be.

04-01 18:59:56.119 7314 7333 E Unity : DllNotFoundException: FirebaseCppApp-5.6.0
04-01 18:59:56.119 7314 7333 E Unity : at (wrapper managed-to-native) Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil(Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
04-01 18:59:56.119 7314 7333 E Unity : at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x000ee] in :0
04-01 18:59:56.119 7314 7333 E Unity : Rethrow as TypeInitializationException: The type initializer for 'SWIGE

me too. it's run in unity editor but not android
why not?

Ran with verbose logs. Found what you were describing:
Target ABIs [armeabi-v7a, x86], ABIs [armeabi-v7a, arm64-v8a, x86] in Assets/Plugins/Android/com.google.firebase.firebase-app-unity-5.4.4.aar, will remove [arm64-v8a] ABIs
Not sure how to add arm64 to the target list. Its set under player settings-> other settings->target architectures.
Thanks

Can you confirm that if you open up the Player Settings..., under the Android tab, Configuration, that ARM64 is checked.

It is a two part process for determining the ABI's that get included in the generated aars. First, it determines what is available based on the Unity version, https://github.com/googlesamples/unity-jar-resolver/blob/master/source/PlayServicesResolver/src/AndroidAbis.cs#L103. Then, after it has generated the libraries, it removed any that are not being used: https://github.com/googlesamples/unity-jar-resolver/blob/master/source/PlayServicesResolver/src/DefaultResolver.cs#L328. If you could share any verbose logs, which I described how to enable previously, we can see if it mentions removing versions that it shouldn't be.

Folks, I took at look at this and I've verified that the Android Resolver is including arm64-v8a libraries when the ABI is enabled in Unity 2018.3.7f on OSX.

Key parts of the Android Resolver's verbose log:

  • Android Target Device ABI changed: armeabi-v7a,x86 -> arm64-v8a,armeabi-v7a,x86
  • Lots of lines like this Target ABIs [armeabi-v7a, arm64-v8a, x86], ABIs [armeabi-v7a, arm64-v8a, x86] in Assets/Plugins/Android/com.google.firebase.firebase-database-unity-5.6.0.aar, will remove [] ABIs

I tested on an arm64 capable device and things work as expected.

To enable arm64 builds in Unity you need to enable IL2CPP which requires installing a specific version of the Android NDK (varying by Unity version).

Could you verify that arm64 is selected in the set of target ABIs:

Screen Shot 2019-04-01 at 9 32 45 AM

Yes I have all three architectures checked but when I run the resolver for some reason its still trying to remove AMR64 from the Target ABIs even though it says its available.

Target ABIs [armeabi-v7a, x86], ABIs [armeabi-v7a, arm64-v8a, x86] in Assets/Plugins/Android/com.google.firebase.firebase-messaging-unity-5.4.4.aar, will remove [arm64-v8a] ABIs UnityEngine.Debug:Log(Object)

If I only check ARMv7 or x86 the output matches what I have checked but its completely ignoring the arm64 check box regardless if its checked or not.

I'm on Unity 2017.4.23f1
Under the Android Resolver Settings I have:
Explode AARs
Patch AndroidManifest.xml
Verbose Logging
Use project settings
all checked

I run with force resolve when I run it.

@davidHutch ah your environment is different to the test environment original filed in the bug report. @WTF-Grinch mentioned 2018.3.7f which makes me wonder what failure they were running into.

@davidHutch trying this out with 2017.4.23f1 I see the issue happening now. It looks like Unity changed how they exposed the ARM64 ABI between 2017 and 2018 :( . I'll see whether I can workaround this.

Well it looks like Unity back ported 64-bit to 2017.4 https://docs.unity3d.com/2017.4/Documentation/ScriptReference/PlayerSettings.Android-targetArchitectures.html which breaks the following module in the Android Resolver:
https://github.com/googlesamples/unity-jar-resolver/blob/d6d7b6bb2058b7c6c7ef0c65b1d98223ca69e420/source/PlayServicesResolver/src/AndroidAbis.cs#L103

I guess I'll whitelist 2017.4 to see whether that fixes the issue.

Scanning back up the history of this issue it looks like the original report of things not working in 2018.x was due to not running the resolver after enabling arm64 so a patch for 2017.4 should close this issue out.

This is fixed in Play Services Resolver release https://github.com/googlesamples/unity-jar-resolver/releases/tag/v1.2.99

We're working on integrating this into a Firebase Unity SDK release but you can pull the latest resolver in the meantime.

@stewartmiles thanks for your help with this. It is working for me now.

Hi all. We've released a new version of the Firebase Unity SDK, 5.6.1, that is using the latest version of the Unity Jar Resolver.

That said, leaving this open for now since the original report was on a newer version of Unity, and shouldn't have been affected by that particular issue.

@a-maurice closing this as @WTF-Grinch solved their issue. They were switching between .NET versions among other environment changes that meant they needed to run the resolver again.

does anybody built in ARM64?? i want to cry!!

For anyone building ARM64 and getting this error:

  • Go to Assets/Firebase/m2repository/com/google/firebase/firebase-app-unity/[version]
  • rename the _.srcaar_ file to _com.google.firebase.firebase-app-unity-[version].aar_ (add com.google.firebase prefix and change extension to .aar)
  • Place file in Assets/Plugins/Android

Done!

Do the same to firebase-messaging-unity.srcaar if needed!

Was this page helpful?
0 / 5 - 0 ratings