firebase / quickstart-unity

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

Unable to find FirebaseCppApp-6_7_0 #514

Closed aldiazj closed 4 years ago

aldiazj commented 4 years ago

Please fill in the following fields:

Unity editor version: 2018.4.9 Firebase Unity SDK version: 6.7.0 Firebase plugins in use : Auth, Database Additional SDKs you are using (Facebook, AdMob, etc.): None Platform you are using the Unity editor on (Mac, Windows, or Linux): Windows Platform you are targeting (iOS, Android, and/or desktop): Android and iOS Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Please describe the issue here:

If I add firebase auth package or the database one, my app will crash on Android leaving this log on console:

Unable to find FirebaseCppApp-6_7_0

DllNotFoundException: Unable to load DLL 'FirebaseCppApp-6_7_0': The specified module could not be 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, 2019-11-15 07:23:53.789 28491-28548/? E/Unity: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-6_7_0': The specified module could not be found. at Firebase.AppUtilPINVOKE.SetLogFunction (Firebase.LogUtil+LogMessageDelegate jarg1) [0x00000] in <00000000000000000000000000000000>:0 at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 at Firebase.LogUtil.Finalize () [0x00000] in <00000000000000000000000000000000>:0

(Filename: currently not available on il2cpp Line: -1)

On the other side, iOS build works fine.

Please answer the following, if applicable:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? NO

muflub commented 4 years ago

Hi @aldiazj,

Can you please browse to Assets\Firebase\m2repository\com\google\firebase\firebase-app-unity and make sure there is only one folder there (should be called 6.7.0). Also make sure to run the android resolver (Assets -> Play Services Resolver -> Android Resolver -> Force Resolve) to ensure all the dependent libraries exist. You can also check the apk file by extracting the contents and ensuring the dll is located at lib\arm64-v8a\libFirebaseCppApp-6_7_0.so.

aldiazj commented 4 years ago

There's only one folder (6.7.0) and a maven file. Also I did run the resolver, forced it, run with default values, and after each attempt I build an APK, none of those attempts generated a libFirebaseCppApp-6_7_0.so.

tonyjoseph456 commented 4 years ago

I also had the same issue. But it's fixed now. The problem was, my Plugins folder was somehow renamed to "plugins", instead of "Plugins". I don't know when and how it got renamed automatically. Maybe it was automatically changed by some of the other plugins which I had earlier used. Even Unity was not allowing me to rename the folder to "Plugins". So I had to close Unity and rename it in Windows Explorer. After that, I had opened Unity and did a force resolve. This time it added all files needed for the project in the Plugins folder. And after taking the build, the issue was resolved.

So my issue was the name of the "Plugins" folder. I had posted it because I thought it might help someone later. Now all my issues are gone and the dll is also located inlib\arm64-v8a\libFirebaseCppApp-6_7_0.so .

youdk commented 4 years ago

Hi, Firebase

Is there any progress? I am facing exactly the same issue after upgrade my SDK from 5.4.4 to 6.7

2019-11-27 18:02:05.183 19568-19623/? E/Unity: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-6_7_0': The specified module could not be found.
      at Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil (Firebase.ExceptionDelegate applicationDelegate, Firebase.ExceptionDelegate arithmeticDelegate, Firebase.ExceptionDelegate divideByZeroDelegate, Firebase.ExceptionDelegate indexOutOfRangeDelegate, Firebase.ExceptionDelegate invalidCastDelegate, Firebase.ExceptionDelegate invalidOperationDelegate, Firebase.ExceptionDelegate ioDelegate, Firebase.ExceptionDelegate nullReferenceDelegate, Firebase.ExceptionDelegate outOfMemoryDelegate, Firebase.ExceptionDelegate overflowDelegate, Firebase.ExceptionDelegate systemExceptionDelegate) [0x00000] in <filename unknown>:0 
      at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x00000] in <filename unknown>:0 
      at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <filename unknown>:0 
      at Firebase.AppUtil.SetLogFunction (Firebase.LogMessageDelegate arg0) [0x00000] in <filename
2019-11-27 18:02:05.194 19568-19636/? E/Unity: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-6_7_0': The specified module could not be found.
      at Firebase.AppUtilPINVOKE.SetLogFunction (Firebase.LogMessageDelegate jarg1) [0x00000] in <filename unknown>:0 
      at Firebase.AppUtil.SetLogFunction (Firebase.LogMessageDelegate arg0) [0x00000] in <filename unknown>:0 
      at Firebase.LogUtil.Finalize () [0x00000] in <filename unknown>:0 
    System.UnhandledExceptionEventHandler:Invoke(Object, UnhandledExceptionEventArgs)
chkuang-g commented 4 years ago

Hi all,

Did you try Force Resolve? Asset > Play Services Resolver > Android Resolver > Force Resolve

Also, could you check if your "Enable Auto Resolution" setting under is turned off under Asset > Play Services Resolver > Android Resolver > Settings

Thank you, Shawn

sujay46 commented 4 years ago

Facing the same issue. There is only one folder(6.7.0). I think it is something to do with the Play Service Resolver. If I open the Unity and build it, it builds the Apk with libFirebaseCppApp-6_7_0.so. But on subsequent builds, it fails. Works only once after restarting the Unity editor. Even force resolve doesn't help in subsequent builds.

Unity version = 2019.2.12f1

youdk commented 4 years ago

Hi, Firebase

I found the dll missing error was caused by google resolver. 

We were using Firebase SDK 5.4.4 and PlayerServiceResolver 1.2.98. After we upgrade Firebase SDK to 6.7.0, PlayerServiceResolver auto upgraded to 1.2.130. Which can not force resolve( which means "Force Resolve" not working, it just pop up "Android Dependencies Resolution Succeeded" immediately).

https://github.com/googlesamples/unity-jar-resolver/releases I also checked the latest version of resolver, 1.2.132. It didn't resolver neither.

Now I rollback PlayerServiceResolver to 1.2.98 manually and force resolve works. But app can't be started.

--------- beginning of crash 2019-11-29 13:54:44.840 6941-6941/? E/AndroidRuntime: FATAL EXCEPTION: main Process: xxxxxxxx, PID: 6941 java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/os/UserManagerCompat; at com.google.firebase.FirebaseApp.initializeAllApis(com.google.firebase:firebase-common@@19.2.0:556) at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.2.0:303) at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.2.0:267) at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@19.2.0:252) at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common@@19.2.0:51) at android.content.ContentProvider.attachInfo(ContentProvider.java:1927) at android.content.ContentProvider.attachInfo(ContentProvider.java:1902) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common@@19.2.0:45) at android.app.ActivityThread.installProvider(ActivityThread.java:6600) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6093) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5999) at android.app.ActivityThread.access$1200(ActivityThread.java:202) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1680) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:6878) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:876) Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.os.UserManagerCompat" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.sports.real.golf.rival.online-

youdk commented 4 years ago

Hi, After 2 weeks' struggle, I finally make Firebase 6.7.0 working in our game.

Almost all the "Not found" issues are related to the migration from Andriod support lib to androidx. Please refer to following links:

https://medium.com/google-developer-experts/converting-your-android-app-to-jetpack-85aecfce34d3 https://itnext.io/react-native-how-to-handle-an-app-with-both-pre-androidx-and-androidx-dependencies-rn60-bf4df7ea0dd2

cynthiajoan commented 4 years ago

@youdk, glad your problem is resolved. We are working on updating the Android resolver to improve the experience of upgrading android -> jetpack.

tomCarnevale commented 4 years ago

I ran into a similar issue. I am on 2019.2.12f1, and was looking for 6.8.0 instead of 6.7.0.

I managed to solve this issue by installing android SDK for 9.0, 8.1, and 8.0 (new laptop). I was targeting 10.0. I also changed my unity android SDK preferences. In Unity Preferences, under External Tools, you can set "Android SDK tools installed with Unity" to false and then navigate to your SDK folder. I think this was the real trick.

ctykaya commented 4 years ago

I am struggling with the same issue on 6.10. When I pressed play button throws an error says dll not found. I check the Firebase-app folder there is only one folder which is 6.10.0 and also unzipped the APK lib/armeabi-v7a/ libFirebaseCppApp-6_10_0.so file is there Nothing helps!! I tried uninstall unity re install, delete firebase and reimport. Disable enable auto resolution still got the error. Cloud any one help ? issue #567

aldiazj commented 4 years ago

At the end I decided to use Firebase through REST and Unity web requests, it's way easier.

chkuang-g commented 4 years ago

@ctykaya

It looks like you had an issue in Editor, not on Android device. Could you offer more detail about your issue in a separate issue? Details like OS version, target platform, Unity version, etc would help us a lot to pinpoint the issue.

Thank you! Shawn