gpt4 book ai didi

firebase - Flutter Firebase 远程配置类中没有虚拟方法 isDeveloperModeEnabled()Z .../FirebaseRemoteConfigSettings

转载 作者:行者123 更新时间:2023-12-04 12:20:33 26 4
gpt4 key购买 nike

我最近升级了 Flutter 项目中的所有 firebase 库。之后,我收到消息:

/flutter (27126): [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/package_name-1UBO7FEPHLsC2_eb7itJLA==/base.apk!classes3.dex)


之后,我的应用程序因错误而崩溃:

[FATAL:flutter/shell/platform/android/platform_view_android_jni_impl.cc(942)] Check failed: CheckException(env).


目前我正在使用:

firebase_remote_config: ^0.4.0+2


firebase_core: 0.5.0+1


我在 android/build.gradle 中的依赖项:
dependencies {
classpath 'com.android.tools.build:gradle:3.6.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.4'
classpath 'io.fabric.tools:gradle:1.28.1'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
}
android/app/build.gradle
dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.firebase:firebase-config:20.0.0'
implementation 'com.facebook.android:facebook-login:7.1.0'
implementation 'com.google.firebase:firebase-messaging:21.0.0'
implementation 'com.google.android.gms:play-services-basement:17.5.0'

configurations.all {
resolutionStrategy.force 'com.google.android.gms:play-services-base:17.1.0'
}
}

最佳答案

终于解决了..
Okey不仅改变了这条线

properties.put("inDebugMode", firebaseRemoteConfigInfo.getConfigSettings().isDeveloperModeEnabled());
properties.put("inDebugMode", false);
&改变这个
FirebaseRemoteConfigSettings settings = new FirebaseRemoteConfigSettings.Builder().setDeveloperModeEnabled(debugMode).build();
firebaseRemoteConfig.setConfigSettings(settings);
FirebaseRemoteConfigSettings settings = new FirebaseRemoteConfigSettings.Builder().build();
firebaseRemoteConfig.setConfigSettingsAsync(settings);
你还需要改变这个
FirebaseRemoteConfig.getInstance().setDefaults(defaults);
FirebaseRemoteConfig.getInstance().setDefaultsAsync(defaults);
仍然是一个烦人的问题,应该尽快解决

关于firebase - Flutter Firebase 远程配置类中没有虚拟方法 isDeveloperModeEnabled()Z .../FirebaseRemoteConfigSettings,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64666600/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com