firebase / firebase-unity-sdk

The Firebase SDK for Unity
http://firebase.google.com
Apache License 2.0
215 stars 35 forks source link

[Bug] NoClassDefFoundError at startup #1072

Closed marcoseverguild closed 1 month ago

marcoseverguild commented 1 month ago

Description

Hello We are experiencing an issue with the last Firebase Unity SDK 12.1.0. We are building aab with multidex and split application binary enabled, Unity 2022.3.13f1

The build seems to crash at startup with this error:

07-18 18:38:35.765 7452 7452 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/Preconditions; 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.checkContentProviderAuthority(FirebaseInitProvider.java:85) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:60) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.app.ActivityThread.installProvider(ActivityThread.java:7940) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.app.ActivityThread.installContentProviders(ActivityThread.java:7451) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7209) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2284) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:240) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.os.Looper.loop(Looper.java:351) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8377) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584) 07-18 18:38:35.765 7452 7452 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

We have tried almost everything, so we are running out of ideas. Some things that we are seeing:

Any suggestions?

Reproducing the issue

No response

Firebase Unity SDK Version

12.1.0

Unity editor version

2022.3.13f1

Installation Method

.unitypackage

Problematic Firebase Component(s)

No response

Other Firebase Component(s) in use

No response

Additional SDKs you are using

Helpshift, Appsflyer, Playfab

Targeted Platform(s)

Android

Unity editor platform

Mac, Windows

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Relevant Log Output

No response

If using CocoaPods for Apple platforms, the project's Podfile.lock

Expand Podfile.lock snippet
```yml đŸ‘€ Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 1 month ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

argzdev commented 1 month ago

Hey @marcoseverguild, thanks for reaching out. Could you share which Firebase products are you using? Thanks!

marcoseverguild commented 1 month ago

Yes, we are using Analytics, Messaging and Database

argzdev commented 1 month ago

Thanks for the extra details, @marcoseverguild. There's an issue with Firebase SDK version 12.1.0. For context, there are breaking changes in Firebase Android SDK which requires compileSdkVersion 34.

Breaking change: Changed the required minimum compileSdkVersion to be 34 or higher. Breaking change: Updated minSdkVersion to API level 21 or higher.

Now according to the Unity forums, Unity Editors currently do not support compileSdkVersion 34, and is currently being worked on by their engineers. There are workarounds, by the Unity engineer, however I haven't tried it myself.

Another mitigation would be to downgrade Firebase SDK version 11.9.0 while waiting for Unity to update the compileSdkVersion on their side.

We'll investigate this further, but it is likely a Android gradle plugin problem that is due to the Unity Editor.

argzdev commented 1 month ago

Hey @marcoseverguild, could you try the solution provided by one of the developers:

Let me know if that makes any difference. Thanks!

google-oss-bot commented 1 month ago

Hey @marcoseverguild. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 1 month ago

Since there haven't been any recent updates here, I am going to close this issue.

@marcoseverguild if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.