googleapis_auth/googleapis_auth.dart URI 不存在

问题描述 投票:0回答:1

我收到“URI 目标不存在:'package:googleapis_auth/googleapis_auth.dart'。”

我需要这个库来向新用户授予角色。

我的 pubspec.yaml 有 googleapis: 13.2.0 并且我运行了 pub get。这是输出:

Resolving dependencies...
Downloading packages...
+ _discoveryapis_commons 1.0.7
  async 2.11.0 (2.12.0 available)
  boolean_selector 2.1.1 (2.1.2 available)
  characters 1.3.0 (1.3.1 available)
  collection 1.18.0 (1.19.1 available)
  fake_async 1.3.1 (1.3.2 available)
  flutter_launcher_icons 0.13.1 (0.14.1 available)
  flutter_lints 4.0.0 (5.0.0 available)
  go_router 12.1.3 (14.3.0 available)
  google_fonts 6.1.0 (6.2.1 available)
  google_sign_in_android 6.1.30 (6.1.33 available)
  google_sign_in_ios 5.7.7 (5.7.8 available)
+ googleapis 13.2.0                   <===== It here
! http 1.2.2 (overridden)
  http_parser 4.0.2 (4.1.1 available)
  image 4.2.0 (4.3.0 available)
  js 0.6.7 (0.7.1 available)
  json_path 0.7.2 (0.7.4 available)
  leak_tracker 10.0.5 (10.0.8 available)
  leak_tracker_flutter_testing 3.0.5 (3.0.9 available)
  lints 4.0.0 (5.1.0 available)
  matcher 0.12.16+1 (0.12.17 available)
  material_color_utilities 0.11.1 (0.12.0 available)
  meta 1.15.0 (1.16.0 available)
  mime_type 1.0.0 (1.0.1 available)
  path 1.9.0 (1.9.1 available)
  path_provider_android 2.2.10 (2.2.12 available)
  path_provider_windows 2.2.1 (2.3.0 available)
  rxdart 0.27.7 (0.28.0 available)
  shared_preferences_android 2.3.2 (2.3.3 available)
  shared_preferences_foundation 2.5.2 (2.5.3 available)
  sign_in_with_apple 6.1.2 (6.1.3 available)
  sqflite 2.3.3+1 (2.4.0 available)
  sqflite_common 2.5.4+3 (2.5.4+5 available)
  stack_trace 1.11.1 (1.12.0 available)
  string_scanner 1.2.0 (1.4.0 available)
  synchronized 3.2.0 (3.3.0+3 available)
  test_api 0.7.2 (0.7.3 available)
  timeago 3.6.1 (3.7.0 available)
  url_launcher 6.3.0 (6.3.1 available)
  url_launcher_android 6.3.10 (6.3.13 available)
  url_launcher_windows 3.1.2 (3.1.3 available)
! uuid 4.5.1 (overridden)
  vm_service 14.2.5 (14.3.1 available)
Changed 2 dependencies!
40 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Process finished with exit code 0

我在https://github.com/google/googleapis.dart/blob/master/googleapis_auth/test/oauth2_flows/auth_code_test.dart

下载了谷歌测试代码

我也遇到同样的问题。

我已重置 IDE,从 pubspec.yaml 中删除 googleapis 并读取它。清理缓存,但仍然没有任何效果。

提前感谢您的帮助。

flutter dart google-iam google-apis-explorer
1个回答
0
投票

googleapis 和 googleapis_auth 是两个不同的包。

在终端中尝试

flutter pub add googleapis_auth

在您的 pubspec 中添加

googleapis_auth

© www.soinside.com 2019 - 2024. All rights reserved.