【问题标题】:FirebaseRemoteConfig Error "No value of type 'String' exists for parameter key"FirebaseRemoteConfig 错误“参数键不存在‘字符串’类型的值”
【发布时间】:2019-08-25 20:55:45
【问题描述】:

我正在使用 Firebase Core 和其他一些功能,但不是远程配置。每秒多次以下输出在 Logcat 上。

我在哪里可以禁用远程配置功能,甚至可以设置那些不存在的值?

依赖关系:

// Project
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.firebase:firebase-plugins:1.2.0'

classpath 'io.fabric.tools:gradle:1.26.1'

// Module
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:preference-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'org.jsoup:jsoup:1.11.3'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.android.support:cardview-v7:28.0.0'

implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-messaging:17.5.0'
implementation 'com.google.firebase:firebase-perf:16.2.4'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.jsibbold:zoomage:1.2.0'
implementation 'com.android.support:exifinterface:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'

implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
W/FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'sessions_max_length_minutes'.
W/FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'sessions_max_length_minutes'.
W/FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'sessions_feature_enabled'.
W/FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'sessions_max_length_minutes'.
W/FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'fpr_vc_trace_sampling_rate'.
W/FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'sessions_feature_enabled'.
W/FirebaseRemoteConfig: No value of type 'String' exists for parameter key 'fpr_vc_trace_sampling_rate'.

我认为这并没有造成任何问题,只是令人讨厌它向控制台发送垃圾邮件。

【问题讨论】:

  • 如果您对 Firebase SDK 有任何反馈,请联系 Firebase 支持。 firebase.google.com/support/contact
  • @DougStevenson 我没有反馈,我只是想知道这个输出是从哪里来的。
  • 我在 GitHub 上创建了一个issue

标签: android firebase firebase-remote-config


【解决方案1】:

Firebase 对我的错误报告的回答:

您似乎收到了一些有关远程配置的警告。我们成功地进行了复制,我们的工程师已经确认这是按预期工作的。发生这种情况是因为在您的应用中添加了性能监控 SDK。这是因为性能监控在内部使用 Firebase 远程配置。但是,我们的工程师已确认他们将在未来尝试减少这些警告。目前,您可以忽略这些,因为它只是一个警告,不会影响应用的性能。

【讨论】:

  • 同时,如果您不想在调试应用时看到它们,您可以为该日志标签创建一个 Android Studio Logcat 过滤器:^(?!(FirebaseRemoteConfig))
  • 如果您可以在此处链接您的错误报告@hrk 将非常有帮助
  • @Sp4Rx 他们这边的参考是 [3-1516000026221] 但我只在 5 月 9 日通过邮件得到答案。这就是为什么我无法链接它。
  • 我读对了吗? “我们不太关心开发者体验”
  • 问题仍然存在于 firebase-perf:19.0.5
【解决方案2】:

它来自firebase-perf 的最新版本(例如,16.2.5),因为它具有内部firebase-remote-config 依赖项。 我有同样的问题,但我不知道如何正确修复此日志垃圾邮件(logcat 中的“像这样折叠行”选项除外)。 我希望 Firebase 团队能尽快修复它。

【讨论】:

  • 也发生在版本 16.2.4 上。等待修复。
  • 感谢“像这样折叠线”的建议。不知道它的存在。
【解决方案3】:

解决方案

Firebase Performance 上周发布了版本19.0.8,以解决日志垃圾邮件问题。 (请参阅发行说明 https://firebase.google.com/support/release-notes/android#2020-07-17)您可以将依赖项 com.google.firebase:firebase-perf 更新为相同或更高版本以验证修复。


说明

解释这个问题的原因:Firebase Performance利用Firebase Remote Config来采样发送到Firebase的事件数量,所以它会调用Firebase Remote Config API getValue(String key) 每次需要采样配置值。

但是,Firebase 远程配置提取每 12 小时进行一次。在开发时可能配置值不存在。在这种情况下,Firebase Performance SDK 将使用默认值

当配置值不存在时,Firebase Remote Config 将生成此日志作为警告,这是 Firebase Performance 用户的日志垃圾邮件的来源。 (见Source Code

我们已将 Firebase Performance 的调用频率降低到 Firebase Remote Config 以避免触发此日志。

【讨论】:

    【解决方案4】:

    如果您使用 Firebase 控制台,在远程配置选项卡中设置这两个值会停止警告。

    我用过:(作为字符串值)

    • 参数键:sessions_max_length_minutes |值:“15”
    • 参数键:sessions_feature_enabled |值:“真”

    不确定是否有任何副作用,但(希望)这是一个内部测试,不会改变任何东西。

    【讨论】:

    • 我不确认这行得通。我们添加了这些键,但没有帮助。
    • 我相信 Firebase Performance 使用远程配置本身作为实现细节(拥有自己的 Firebase 项目,归 Google 所有)。
    【解决方案5】:

    Firebase 性能监控在内部使用 Firebase 远程配置。您无法更改输出,但您可以使用我在上面评论中提供的链接send feedback to the team

    【讨论】:

      【解决方案6】:

      不再需要 Firebase Android 库 firebase-core。这 SDK 包括用于 Google Analytics 的 Firebase SDK。

      删除 build.gradle 中的 firebase-core

      【讨论】:

      【解决方案7】:

      这可能与以下因素有关或结果:

      W/zzd: Application name is not set. Call Builder#setApplicationName
      

      禁用perf-plugin & firebase-perf 会删除烦人的日志条目:

      // classpath "com.google.firebase:perf-plugin:1.2.1"
      // apply plugin: "com.google.firebase.firebase-perf"
      // implementation "com.google.firebase:firebase-perf:17.0.0"
      

      firebase-config 自己运行良好。

      【讨论】:

        【解决方案8】:

        这是我的观察:

        如果您在 RemoteConfig console 上设置了特定的 key 并且没有在默认 xml 中添加 default 键(在 setDefaultsAsync() 中传递)。

        如果,对于一些罕见的情况,
        要么没有连接,要么 Firebase RemoteConfig 无法获取值,如果特定的 key 用于获取默认值,
        您可能会在 Logcat 中收到该消息。

        【讨论】:

          猜你喜欢
          • 2021-12-20
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-09-20
          • 2020-04-12
          • 1970-01-01
          • 1970-01-01
          • 2018-06-19
          相关资源
          最近更新 更多