Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError FirebaseCrashlyticsNdk class is included in your app. #1177

Closed
keepup opened this issue Nov 9, 2021 · 6 comments
Closed

Comments

@keepup
Copy link

keepup commented Nov 9, 2021

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2019.4.24
  • Firebase Unity SDK version: 8.6.0
  • Source you installed the SDK: .unitypackage (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: FirebaseCrashlytics (Auth, Database, etc.)
  • Other Firebase Components in use: Cloud Messaging / Google Analytics (Auth, Database, etc.)
  • Additional SDKs you are using: Facebook/AdMob/Ironsource (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Mac (Mac, Windows, or Linux)
  • Platform you are targeting: Android (iOS, Android, and/or desktop)
  • Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)

[REQUIRED] Please describe the question here:

This is logs:

2021/11/09 19:05:53.565 28667 28744 Warn System.err java.lang.NoSuchMethodError: no static method "Lcom/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk;.getInstance()Lcom/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk;"
2021/11/09 19:05:53.565 28667 28744 Warn System.err 	at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
2021/11/09 19:05:53.565 28667 28744 Warn System.err 	at com.unity3d.player.UnityPlayer.access$600(Unknown Source:0)
2021/11/09 19:05:53.565 28667 28744 Warn System.err 	at com.unity3d.player.UnityPlayer$f$1.handleMessage(Unknown Source:150)
2021/11/09 19:05:53.565 28667 28744 Warn System.err 	at android.os.Handler.dispatchMessage(Handler.java:102)
2021/11/09 19:05:53.565 28667 28744 Warn System.err 	at android.os.Looper.loop(Looper.java:236)
2021/11/09 19:05:53.565 28667 28744 Warn System.err 	at com.unity3d.player.UnityPlayer$f.run(Unknown Source:20)
2021/11/09 19:05:53.565 28667 28744 Error firebase method_ids[i] || (method.optional == kMethodOptional)
2021/11/09 19:05:53.566 28667 28744 Error Unity method_ids[i] || (method.optional == kMethodOptional)
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.Crashlytics.CrashlyticsInternalPINVOKE:FirebaseCrashlyticsInternal_GetInstance__SWIG_0(HandleRef, Int32&)
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.Crashlytics.FirebaseCrashlyticsInternal:GetInstance(FirebaseApp, InitResult&)
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.Crashlytics.AndroidImpl:.ctor()
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.Crashlytics.Impl:Make()
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.Crashlytics.PlatformAccessor:.cctor()
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.Crashlytics.Crashlytics:Initialize()
2021/11/09 19:05:53.566 28667 28744 Error Unity System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.FirebaseApp:InitializeCrashlyticsIfPresent()
2021/11/09 19:05:53.566 28667 28744 Error Unity System.Func`1:Invoke()
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.FirebaseApp:CreateAndTrack(CreateDelegate, FirebaseApp)
2021/11/09 19:05:53.566 28667 28744 Error Unity Firebase.Analytics.FirebaseAnalytics:.cctor()
2021/11/09 19:05:53.566 28667 28744 Error Unity CapUnity.Services.Stat.FirebaseStatService:SetUserProperty(String, String)
2021/11/09 19:05:53.566 28667 28744 Error Unity Escape.<OnAppStart>d__98:MoveNext()
2021/11/09 19:05:53.566 28667 28744 Error Unity System.Threading.ContextCallback:Invoke(Object)
2021/11/09 19:05:53.566 28667 28744 Error Unity System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
2021/11/09 19:05:53.566 28667 28744 Error Unity System.Runtime.CompilerServices.MoveNextRunner:Run()
2021/11/09 19:05:53.566 28667 28744 Error Unity System.Action
2021/11/09 19:05:53.566 28667 28744 Error firebase Unable to find Method com/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk.getInstance (signature '()Lcom/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk;', static).  Please verify the AAR which contains the com/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk class is included in your app.

@paulinon paulinon removed the new New issue. label Nov 9, 2021
@PrisedRabbit
Copy link

PrisedRabbit commented Nov 9, 2021

Same here, but Unity 2020.3.22:

  E/Unity: ApplicationException: Unable to find Method com/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk.getInstance (signature '()Lcom/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk;', static).  Please verify the AAR which contains the com/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk class is included in your app.
  at Firebase.Crashlytics.FirebaseCrashlyticsInternal.GetInstance (Firebase.FirebaseApp app, Firebase.InitResult& init_result_out) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.AndroidImpl..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Impl.Make () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.Initialize () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAtt

@AjayC-Bsw
Copy link

AjayC-Bsw commented Nov 9, 2021

Same Problem with Unity 2019.4.30
Firebase Unity SDK version: 8.6.0
Google Admob - 6.1.2
Scripting Backend - IL2CPP and MONO

Unable to find Method com/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk.getInstance (signature '()Lcom/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk;', static). Please verify the AAR which contains the com/google/firebase/crashlytics/ndk/FirebaseCrashlyticsNdk class is included in your app.

method_ids[i] || (method.optional == kMethodOptional)
Firebase.Crashlytics.CrashlyticsInternalPINVOKE:FirebaseCrashlyticsInternal_GetInstance__SWIG_0(HandleRef, Int32&)
Firebase.Crashlytics.FirebaseCrashlyticsInternal:GetInstance(FirebaseApp, InitResult&)
Firebase.Crashlytics.AndroidImpl:.ctor()
Firebase.Crashlytics.Impl:Make()
Firebase.Crashlytics.PlatformAccessor:.cctor()
Firebase.Crashlytics.Crashlytics:Initialize()
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
Firebase.FirebaseApp:InitializeCrashlyticsIfPresent()
System.Func1:Invoke() Firebase.FirebaseApp:CreateAndTrack(CreateDelegate, FirebaseApp) CrashlyticsInit:<Start>b__4_0(Task1)
System.Action1:Invoke(T) Firebase.Extensions.<ContinueWithOnMainThread>c__AnonStorey9:<>m__0() System.Func1:Invoke()
Firebase.c__AnonStorey1`1:<>m__0()
System.Action:Invoke()
Firebase.ExceptionAggregator:Wrap(Action)
Firebase.Dispatcher:PollJobs()
Firebase.Platform.FirebaseHandler:Update()

@paulinon
Copy link
Contributor

paulinon commented Nov 9, 2021

Thanks for reporting this, @keepup.

May I know how this issue could be replicated so that we can identify what's causing this? Could you also confirm if your implementation is using the IL2CPP scripting backend?

@paulinon paulinon added needs-info Need information for the developer type: bug and removed type: question needs-info Need information for the developer labels Nov 9, 2021
@mrichards
Copy link

Hi @keepup & @AjayC-Bsw, it looks like the version of Crashlytics for Android didn't get updated with this release of our Unity SDK. The following workaround should resolve the problem:

Open Assets/Firebase/Editor/CrashlyticsDependencies.xml. Change the version of com.google.firebase:firebase-crashlytics-ndk:18.0.1 to 18.2.4.

This will cause the dependency resolver to download the correct version of the Crashlytics Android SDK, which includes the missing method identified in the error message. Subsequent builds should work as expected.

Our next release will include the correct dependency version, so this workaround will not be required in the future.

@mrichards mrichards self-assigned this Nov 9, 2021
@solinvictus1313
Copy link

The workaround seems to work nicely. I still have to check the actual crash reporting functionality after this upgrade, but this brings me a lot closer. Thanks a lot @mrichards

11-09 21:17:36.663 21521 21521 I FirebaseCrashlytics: Initializing Firebase Crashlytics 18.2.4 for com.asd.xyz
11-09 21:17:37.905 21521 21606 D libcrashlytics: Initializing libcrashlytics version 3.1.0
11-09 21:17:37.906 21521 21606 D libcrashlytics: Initializing native crash handling successful.

@a-maurice
Copy link
Contributor

We've just released a new version, 8.6.1, which has the correct Assets/Firebase/Editor/CrashlyticsDependencies.xml file. Thanks for bringing this issue to our attention.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants