0
votes

I'm trying to use remote config in my flutter App. But it causes some issue. The error caused is as below.

E/flutter (19619): [ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(43)] java.lang.NoSuchMethodError: No virtual method 
isDeveloperModeEnabled()Z in class Lcom/google/firebase/remoteconfig/FirebaseRemoteConfigSettings; or its super classes 
(declaration of 'com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings' appears in /data/app/com.agri.market-4xZBgi-vKLAW5hRoXz6r0Q==/base.apk!classes2.dex)

The Code is used in init state and the remote config code is here.

WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
      final remoteConfig = await RemoteConfig.instance;
      final defaults = <String, dynamic>{
        'pubAd': false,
      };
      await remoteConfig.fetch(expiration: const Duration(hours: 4));
      await remoteConfig.activateFetched().then((value) {
        toastMessage().showToastMessage(value);
      });
    });

Please someone help me with this guys!

1

1 Answers

2
votes

In other posts you'll see a suggested modification of a MethodCallHandlerImpl.javafile in the .pub-cachehosted/pub.dartlang.org/firebase_remote_config-0.4.2/android/src/main/java/io/flutter/firebase/firebaseremoteconfig route .. as found at https://github.com/FirebaseExtended/flutterfire/issues/4035 .

In my case just changing the platform('com.google.firebase:firebase-bom:26.4.0') to implementation platform('com.google.firebase:firebase-bom') in my android/app/src/main/AndroidManifest.xmlfile fixed the problem.