如何修复 Google 令牌服务 API 错误?
How to fix Google Token service API error?
我正在使用 Flutter、Google 登录、Firebase 实时数据库构建应用程序。
我发现登录后一个小时后数据库未连接,因为令牌服务API 不工作。
我正在为 firebase 使用以下插件。
google_sign_in: ^5.2.3
firebase_auth: ^3.3.5
firebase_core: ^1.11.0
firebase_database: ^9.0.6
并且我在一些构造函数中启用了日志记录来调试这个问题。
_database = FirebaseDatabase.instanceFor(
app: Firebase.app(),
databaseURL: _databasesURL,
);
...
_database.setLoggingEnabled(true);
_database.setPersistenceEnabled(true);
而且没有什么特别的东西。只是我正在使用 DatabaseReference.onValue
、DatabaseReference.update
函数。
我觉得我在云平台做错了什么。如何修复令牌服务?
日志
D/Persistence( 4874): Persisted user merge in 0ms
D/Persistence( 4874): Transaction completed. Elapsed: 8ms
D/EventRaiser( 4874): Raising 1 event(s)
D/RepoOperation( 4874): Aborting transactions for path: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/excepted_words. Affected: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/excepted_words
D/RepoOperation( 4874): Aborting transactions for path: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/my_list_id. Affected: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/my_list_id
D/EventRaiser( 4874): Raising /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences: VALUE: {selection_method=무작위 뽑기, my_list_id=a14f61e0-8e1e-11ec-b4e5-239623bc0e23}
D/RepoOperation( 4874): Aborting transactions for path: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/selection_method. Affected: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/selection_method
D/EGL_emulation( 4874): app_time_stats: avg=116.29ms min=2.59ms max=1818.17ms count=18
D/PersistentConnection( 4874): pc_0 - Trying to fetch auth token
D/PersistentConnection( 4874): pc_0 - Trying to fetch app check token
W/System ( 4874): Ignoring header X-Firebase-Locale because its value was null.
D/PersistentConnection( 4874): pc_0 - Error fetching token: java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
D/PersistentConnection( 4874): pc_0 - Scheduling connection attempt
D/ConnectionRetryHelper( 4874): Scheduling retry in 9016ms
D/PersistentConnection( 4874): pc_0 - Trying to fetch auth token
D/PersistentConnection( 4874): pc_0 - Trying to fetch app check token
W/System ( 4874): Ignoring header X-Firebase-Locale because its value was null.
D/PersistentConnection( 4874): pc_0 - Error fetching token: java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
D/PersistentConnection( 4874): pc_0 - Scheduling connection attempt
D/ConnectionRetryHelper( 4874): Scheduling retry in 22917ms
D/PersistentConnection( 4874): pc_0 - Trying to fetch auth token
D/PersistentConnection( 4874): pc_0 - Trying to fetch app check token
W/System ( 4874): Ignoring header X-Firebase-Locale because its value was null.
D/PersistentConnection( 4874): pc_0 - Error fetching token: java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
D/PersistentConnection( 4874): pc_0 - Scheduling connection attempt
D/ConnectionRetryHelper( 4874): Scheduling retry in 15233ms
D/PersistentConnection( 4874): pc_0 - Trying to fetch auth token
D/PersistentConnection( 4874): pc_0 - Trying to fetch app check token
W/System ( 4874): Ignoring header X-Firebase-Locale because its value was null.
D/PersistentConnection( 4874): pc_0 - Error fetching token: java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
D/PersistentConnection( 4874): pc_0 - Scheduling connection attempt
D/ConnectionRetryHelper( 4874): Scheduling retry in 29761ms
API 错误屏幕截图
正如@MaNDOOoo 提到的,这个问题可以通过多次重新创建 Firebase 项目来解决。
在其他一些情况下,以下解决方案可以解决问题。
-如果令牌服务有任何错误API。这可以通过以下方式解决
按照以下步骤操作:
- 转到URL
- 点击 API 键
- 使用“Identity Toolkit API”启用“令牌服务 API”
-如果需要,可以参考github link在Firebase控制台中启用匿名Sign-in。
我正在使用 Flutter、Google 登录、Firebase 实时数据库构建应用程序。
我发现登录后一个小时后数据库未连接,因为令牌服务API 不工作。
我正在为 firebase 使用以下插件。
google_sign_in: ^5.2.3
firebase_auth: ^3.3.5
firebase_core: ^1.11.0
firebase_database: ^9.0.6
并且我在一些构造函数中启用了日志记录来调试这个问题。
_database = FirebaseDatabase.instanceFor(
app: Firebase.app(),
databaseURL: _databasesURL,
);
...
_database.setLoggingEnabled(true);
_database.setPersistenceEnabled(true);
而且没有什么特别的东西。只是我正在使用 DatabaseReference.onValue
、DatabaseReference.update
函数。
我觉得我在云平台做错了什么。如何修复令牌服务?
日志
D/Persistence( 4874): Persisted user merge in 0ms
D/Persistence( 4874): Transaction completed. Elapsed: 8ms
D/EventRaiser( 4874): Raising 1 event(s)
D/RepoOperation( 4874): Aborting transactions for path: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/excepted_words. Affected: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/excepted_words
D/RepoOperation( 4874): Aborting transactions for path: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/my_list_id. Affected: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/my_list_id
D/EventRaiser( 4874): Raising /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences: VALUE: {selection_method=무작위 뽑기, my_list_id=a14f61e0-8e1e-11ec-b4e5-239623bc0e23}
D/RepoOperation( 4874): Aborting transactions for path: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/selection_method. Affected: /QGJ11CRtkVaSKAsdomHgVT0Gghs2/search_tap_preferences/selection_method
D/EGL_emulation( 4874): app_time_stats: avg=116.29ms min=2.59ms max=1818.17ms count=18
D/PersistentConnection( 4874): pc_0 - Trying to fetch auth token
D/PersistentConnection( 4874): pc_0 - Trying to fetch app check token
W/System ( 4874): Ignoring header X-Firebase-Locale because its value was null.
D/PersistentConnection( 4874): pc_0 - Error fetching token: java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
D/PersistentConnection( 4874): pc_0 - Scheduling connection attempt
D/ConnectionRetryHelper( 4874): Scheduling retry in 9016ms
D/PersistentConnection( 4874): pc_0 - Trying to fetch auth token
D/PersistentConnection( 4874): pc_0 - Trying to fetch app check token
W/System ( 4874): Ignoring header X-Firebase-Locale because its value was null.
D/PersistentConnection( 4874): pc_0 - Error fetching token: java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
D/PersistentConnection( 4874): pc_0 - Scheduling connection attempt
D/ConnectionRetryHelper( 4874): Scheduling retry in 22917ms
D/PersistentConnection( 4874): pc_0 - Trying to fetch auth token
D/PersistentConnection( 4874): pc_0 - Trying to fetch app check token
W/System ( 4874): Ignoring header X-Firebase-Locale because its value was null.
D/PersistentConnection( 4874): pc_0 - Error fetching token: java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
D/PersistentConnection( 4874): pc_0 - Scheduling connection attempt
D/ConnectionRetryHelper( 4874): Scheduling retry in 15233ms
D/PersistentConnection( 4874): pc_0 - Trying to fetch auth token
D/PersistentConnection( 4874): pc_0 - Trying to fetch app check token
W/System ( 4874): Ignoring header X-Firebase-Locale because its value was null.
D/PersistentConnection( 4874): pc_0 - Error fetching token: java.util.concurrent.ExecutionException: 1 out of 2 underlying tasks failed
D/PersistentConnection( 4874): pc_0 - Scheduling connection attempt
D/ConnectionRetryHelper( 4874): Scheduling retry in 29761ms
API 错误屏幕截图
正如@MaNDOOoo 提到的,这个问题可以通过多次重新创建 Firebase 项目来解决。
在其他一些情况下,以下解决方案可以解决问题。
-如果令牌服务有任何错误API。这可以通过以下方式解决 按照以下步骤操作:
- 转到URL
- 点击 API 键
- 使用“Identity Toolkit API”启用“令牌服务 API”
-如果需要,可以参考github link在Firebase控制台中启用匿名Sign-in。