Android Firebase 远程配置:未设置应用程序名称。呼叫生成器#setApplicationName
Android Firebase Remote Config: Application name is not set. Call Builder#setApplicationName
每当我调用 FirebaseRemoteConfig.getInstance()
时,我都会收到此警告:
W/zze: Application name is not set. Call Builder#setApplicationName.
我已经从 Firebase 更新了 json 配置文件,但它保持不变。它不影响任何功能,但我不禁觉得缺少了一些东西。我可能在某处遗漏了任何配置吗?
这对我有用。
我使用 Flutter 项目
添加 await remoteConfig.fetch(expiration: const Duration(seconds: 0));
和 await remoteConfig.activateFetched();
void _adminValidate() async {
try{
final RemoteConfig remoteConfig = await RemoteConfig.instance;
await remoteConfig.fetch(expiration: const Duration(seconds: 0));
await remoteConfig.activateFetched();
print(remoteConfig.getString('admin'));
}catch (e){
print(e);
}
}
此警告已在 firebase-config 19.0.2
中解决。
因此,如果您将库升级到此版本:
implementation 'com.google.firebase:firebase-config:19.0.2'
警告消失。
无论如何,即使这个警告污染了我们的日志消息,使用以前版本的 firebase 配置的应用程序也确实按预期运行。
每当我调用 FirebaseRemoteConfig.getInstance()
时,我都会收到此警告:
W/zze: Application name is not set. Call Builder#setApplicationName.
我已经从 Firebase 更新了 json 配置文件,但它保持不变。它不影响任何功能,但我不禁觉得缺少了一些东西。我可能在某处遗漏了任何配置吗?
这对我有用。 我使用 Flutter 项目
添加 await remoteConfig.fetch(expiration: const Duration(seconds: 0));
和 await remoteConfig.activateFetched();
void _adminValidate() async {
try{
final RemoteConfig remoteConfig = await RemoteConfig.instance;
await remoteConfig.fetch(expiration: const Duration(seconds: 0));
await remoteConfig.activateFetched();
print(remoteConfig.getString('admin'));
}catch (e){
print(e);
}
}
此警告已在 firebase-config 19.0.2
中解决。
因此,如果您将库升级到此版本:
implementation 'com.google.firebase:firebase-config:19.0.2'
警告消失。
无论如何,即使这个警告污染了我们的日志消息,使用以前版本的 firebase 配置的应用程序也确实按预期运行。