question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Unable to find Method com/google/firebase/remoteconfig/ConfigUpdateListenerRegistration.remove

See original GitHub issue

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2021.3.24f1
  • Firebase Unity SDK version: 11.1.0
  • Source you installed the SDK: .tgz
  • Problematic Firebase Component: remote config
  • Other Firebase Components in use: messaging, analytics
  • Additional SDKs you are using: Google Play AppUpdate, AppBundle, AssetDelivery, InAppReview
  • Platform you are using the Unity editor on: Windows/Mac
  • Platform you are targeting: Android
  • Scripting Runtime: IL2CPP
  • Pre-built SDK from the website or open-source from this repo: prebuilt

[REQUIRED] Please describe the issue here:

Since the v11.0 upgrade when I launch the app and try to access FirebaseRemoteConfig.DefaultInstance, I have the following warning on the logcat console: java.lang.NoSuchMethodError: no non-static method “Lcom/google/firebase/remoteconfig/ConfigUpdateListenerRegistration;.remove()V”

followed by the error: Unable to find Method com/google/firebase/remoteconfig/ConfigUpdateListenerRegistration.remove (signature ‘()V’, instance). Please verify the AAR which contains the com/google/firebase/remoteconfig/ConfigUpdateListenerRegistration class is included in your app.

What’s the issue repro rate? 100%

using Firebase version 10.7.0 everything works as expected.

Relevant Code:

FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => 
{
    var dependencyStatus = task.Result;
    if( dependencyStatus == DependencyStatus.Available ) 
    {
        // this log appear in the console
        Debug.Log( $"RemoteConfig --- FIREBASE CheckAndFixDependenciesAsync complete. {task.Result}" );

        // Create and hold a reference to your FirebaseApp,
        // where app is a Firebase.FirebaseApp property of your application class.
        FirebaseAppInstance = FirebaseApp.DefaultInstance;

        
        // Apply RemoteConfig default values
        FirebaseRemoteConfig.DefaultInstance.SetDefaultsAsync( DefaultValues ).ContinueWithOnMainThread( _ =>
        {
           // This log never appear in the console
           Debug.Log( "FIREBASE SetDefaultsAsync complete." );
            
            // Get config from Firebase
            FirebaseRemoteConfig.DefaultInstance.FetchAndActivateAsync().ContinueWithOnMainThread( _ =>
            {
                var remoteConfig = FirebaseRemoteConfig.DefaultInstance;
                var info         = remoteConfig.Info;
                
                // TODO get values from RemoteConfig
            } );
        } );
    } 
    else 
    {
        Debug.LogError( $"Could not resolve all Firebase dependencies: {dependencyStatus}" );
        // Firebase Unity SDK is not safe to use here.
    }
});

see attached my mainTemplate.gradle file mainTemplate.gradle.txt

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lagoonbbbocommented, Jun 15, 2023

Ok, it worked ! Thank you very much.

1reaction
a-mauricecommented, Jun 14, 2023

Hi @lagoonbbbo

Thanks for the bug report. The problem is that the symbols are being stripped by minification. We will try to get this fixed in the next release, but in the meantime, a pretty simple workaround is available.

In your Assets/Plugins/Android/proguard-user.txt file, you can add:

-keep,includedescriptorclasses public class com.google.firebase.remoteconfig.ConfigUpdateListenerRegistration { *; }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to find method 'org.gradle.api.file.ProjectLayout. ...
The issue was that I upgraded to Android Studio v4, and seem like the download project was created using Android Studio v3. After...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found