firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
839 stars 434 forks source link

DllNotFoundException: App Error on Android Device #143

Closed Oni22 closed 6 years ago

Oni22 commented 6 years ago

hey :) I'm using the FirebaseAnalytics plugin for unity and I got this error message.:

DllNotFoundException: App 03-14 19:12:21.159 12740 12759 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)

I build the game and test it on an android device. I got this error while running the app and see it in the android logcat console. So in the start function in unity I'm running the firebase code and at this point the game stucks and throws this error

stewartmiles commented 6 years ago

@Oni22 for future reference, it would be great to point out when you cross post an issue. This is cross posted here https://stackoverflow.com/questions/49285840/firebase-unity-error-dllnotfoundexception-app

We (like many other plugins) use the Android Resolver to download and incorporate Android library dependencies: https://github.com/googlesamples/unity-jar-resolver#auto-resolution

From my response to https://github.com/firebase/quickstart-unity/issues/53

" Perhaps you have no AAR files in your project under Plugins/Android?

You may have disabled the Android Resolver which would add the AAR dependencies for you. You can enable the Android Resolver from the menu under

Assets --> Play Services Resolver--> Android --> Settings Then check Enable Background Resolution

Finally, since resolution was probably disabled run it manually using the Assets --> Play Services Resolver--> Android --> Force Resolve menu option "

Cheers, Stewart

Oni22 commented 6 years ago

Okey, I will pay attention :)

So but the problem is I cant find this option "Enable Background Resolution" and I installed the newest Playe Service Resolver...

aaaaaaaaaaaaaaaaaaa

This is my Path Assets --> Play Services Resolver--> Android Resolver --> Settings

stewartmiles commented 6 years ago

'Enable Background Resolution' was renamed to 'Enable Auto-Resolution' looks like you have it checked.

Oni22 commented 6 years ago

Oh okey and I do Force Resolve but nothing changed

Oni22 commented 6 years ago

I'm using Unity 2017.3.1f1 and JDK 8u162, android sdk is up to date

stewartmiles commented 6 years ago

Which architecture are you building for?

What is in your Plugins/Android/ directory?

Oni22 commented 6 years ago

ssss

for android

Oni22 commented 6 years ago

I guess there missing files how you said

stewartmiles commented 6 years ago

Is the Android Resolver failing? Did you check the console for error messages?

You've shared a screenshot of the folder view, it should contains a load of files / folders like com.google.firebase.* etc.

Oni22 commented 6 years ago

Yeah i know. So after I clicked on Force Resolve this window appears:

eeeeeeeee

I hit yes but after that this error appears:

wwwwwwwwwwww

Oni22 commented 6 years ago

and I got "Gradle failed to fetch dependencies" error in the unity console

stewartmiles commented 6 years ago

Any chance you could share your Unity.log file? It sounds like a bug in the resolver that we just happen to be looking at right now.

stewartmiles commented 6 years ago

Ok we resolved an issue with the Android Resolver, you can give this a try https://github.com/googlesamples/unity-jar-resolver/blob/master/play-services-resolver-1.2.64.0.unitypackage

Oni22 commented 6 years ago

Hmm same issue. I got the same error windows as I showed you in the previous post of me. So here is my editor log file: Editor.log

Meanwhile I tested if the issue appears on another machine but nothing of them. On another machine the plugin imports all files and folder. I thought my android sdk or something like that is broken but after reinstall of all components nothing changed.

Oni22 commented 6 years ago

Here the Error from the console:

Gradle failed to fetch dependencies.

Failed to run 'C:\Users\On\Desktop\TEEEST\Test\Temp\PlayServicesResolverGradle\gradlew.bat -b "C:\Users\On\Desktop\TEEEST\Test\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" --daemon "-PANDROID_HOME=C:/Users/On/AppData/Local/Android/Sdk" "-PTARGET_DIR=C:\Users\On\Desktop\TEEEST\Test\Assets\Plugins\Android" "-PMAVEN_REPOS=" "-PPACKAGES_TO_COPY="' stdout: Starting a Gradle Daemon (subsequent builds will be faster)

stderr:

FAILURE: Build failed with an exception.

FAILURE: Build failed with an exception.

exit code: 1

UnityEngine.Debug:LogError(Object) Google.Logger:Log(String, LogLevel) GooglePlayServices.PlayServicesResolver:Log(String, LogLevel) GooglePlayServices.cAnonStorey14:<>m1F(Result) GooglePlayServices.cAnonStorey15:<>m28() GooglePlayServices.PlayServicesResolver:PumpUpdateQueue() UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

stewartmiles commented 6 years ago

@Oni22 is it possible you have any anti-virus software or anything else on your machine that is preventing Gradle from executing? If you manually run the command that is failing from the command line does it work?

Oni22 commented 6 years ago

I tested both but no change.

Oni22 commented 6 years ago

I reinstall JDK and Android SDK but nothing changed this is very strange

stewartmiles commented 6 years ago

@Oni22 when you mention you tested both, what do you mean? Did you try running Gradle from the command line (you'll need to keep Unity open so that it doesn't delete the Temp directory) ?

Have you reproduced this on another machine?

Is there anything you can share regarding your OS version or anything else installed on your machine that may be causing this to fail? It's certainly very strange that it simply can't run Gradle. Is the machine not connected to the internet, if so the Gradle wrapper (which bootstraps Gradle) won't be able to fetch Gradle or download the Android dependencies.

Oni22 commented 6 years ago

Yes I run gradle from command line while Unity was open. I import the package on another machine but there was everything ok. On the other machine my app works well after building. So no I couldn't reproduce this on another machine. My internet works. On my machine unity always trys to import the m2repository and after that it fails. On the other machine nothing of this happened.

Im using: -Windows 10 Version 1709 Pro

stewartmiles commented 6 years ago

I had a quick Google on this since it's related more to Gradle than our use of it...

https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/modification-development/2881869-could-not-create-service-of-type

Thread ends on a solution here: https://stackoverflow.com/questions/30840526/gradle-could-not-create-service-of-type-initscripthandler-using-buildscopeservic

Oni22 commented 6 years ago

nothing helps still same error...

vratislavino commented 6 years ago

Hello, I've got the same problem. Is there anything new? I've read this and there i found that this error is because of missing (C/C++) .so files. Where are these files located? I've seen a lot of .arr libs, even .pom and .srcaar, but no .so.

Build will proceed without errors, but when I start application and try to use anything from Firebase (like FirebaseStorage or FirebaseDatabase), the error from original question will apear (even with library version so: DllNotFoundException: App-4.5.2 I attach full error image

Thanks in advance, guys

stewartmiles commented 6 years ago

@vratislavino it sounds like you didn't run the Android Resolver (by default it runs automatically) to pull the Android components required by Firebase into your build. The .so files for Android are in the *.srcaar files that are distributed as part of the plugin.

@Oni22 I suggest opening up a ticket with support https://firebase.google.com/support/ where you can have someone debug this with you.

stewartmiles commented 6 years ago

Haven't heard from anyone on this in a while, I'll assume you solved the issue, closing this out.

ctykaya commented 5 years ago

Hello @stewartmiles I am struggling with the same problem in Firebase SDK 5.5.0. I read all your answers but nothing help. I am using latest GPS and AdMob services in my game. Pass through all the step in firebase.com. Can you help ?

alexames commented 5 years ago

Can you open a new issue and give some more detail on what steps you took? Have you tried reproducing the issue in the quickstart testapp? If you can get the quickstart working, we can start drilling down into what might be wrong in your app.