简体   繁体   中英

Problem trying to instantiate Firebase RemoteConfig in Flutter

When I try to instantiate RemoteConfig, I get this error and the app crashes (not an error, it just closes). I've read that a workaround would be : Workaround: go to your pub cache dir, find MethodCallHandler.java and replace this line:

properties.put(
              "inDebugMode", firebaseRemoteConfigInfo.getConfigSettings().isDeveloperModeEnabled());

With this:

properties.put("inDebugMode", false);

The problem is that this file does not contain any line as it was described. Any ideas?

Full error:

E/flutter ( 4211):  at android.app.ActivityThread.main(ActivityThread.java:7356)
E/flutter ( 4211):  at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 4211):  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/flutter ( 4211):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/flutter ( 4211):
F/flutter ( 4211): [FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(942)] Check failed: CheckException(env).
F/libc    ( 4211): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 4211 (name_app), pid 4211 (name_app)

The workaround didn't work for me but 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.xml file fixed the problem. Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM