"flutter pub get" not downloading dependencies in pubspec.yaml - Stack Overflow

admin2025-04-28  2

I'm on a Mac, working in VS Code trying to develop an app-- I added flutter_tex as a dependency to my pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  flutter_tex: ^4.0.13
  webview_flutter: ^4.10.0
  cupertino_icons: ^1.0.8

but when I run "flutter pub get", it downloads several packages, but not flutter_tex. I've tried restarting (VS Code as well as my computer), adding other dependencies (which did not download either), I've tried "flutter clean", "flutter packages get", "flutter packages upgrade", I've tried "flutter pub cache repair", I've tried "Dart: restart analysis server", but no matter what, upon running "flutter pub get", the output is:

Resolving dependencies... 
Downloading packages... 
  async 2.11.0 (2.12.0 available)
  boolean_selector 2.1.1 (2.1.2 available)
  characters 1.3.0 (1.4.0 available)
  clock 1.1.1 (1.1.2 available)
  collection 1.19.0 (1.19.1 available)
  fake_async 1.3.1 (1.3.2 available)
  leak_tracker 10.0.7 (10.0.8 available)
  leak_tracker_flutter_testing 3.0.8 (3.0.9 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)
  path 1.9.0 (1.9.1 available)
  source_span 1.10.0 (1.10.1 available)
  stack_trace 1.12.0 (1.12.1 available)
  stream_channel 2.1.2 (2.1.4 available)
  string_scanner 1.3.0 (1.4.1 available)
  term_glyph 1.2.1 (1.2.2 available)
  test_api 0.7.3 (0.7.4 available)
  vm_service 14.3.0 (15.0.0 available)
Got dependencies!
19 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information. 

And I did run "flutter pub outdated" and here was the output:

Showing outdated packages.
[*] indicates versions that are not the latest available.

Package Name                  Current     Upgradable  Resolvable  Latest   

direct dependencies: all up-to-date.

dev_dependencies: all up-to-date.

transitive dependencies:     
characters                    *1.3.0      *1.3.0      *1.3.0      1.4.0    
collection                    *1.19.0     *1.19.0     *1.19.0     1.19.1   
material_color_utilities      *0.11.1     *0.11.1     *0.11.1     0.12.0   
meta                          *1.15.0     *1.15.0     *1.15.0     1.16.0   
path                          *1.9.0      *1.9.0      *1.9.0      1.9.1    

transitive dev_dependencies: 
async                         *2.11.0     *2.11.0     *2.11.0     2.12.0   
boolean_selector              *2.1.1      *2.1.1      *2.1.1      2.1.2    
clock                         *1.1.1      *1.1.1      *1.1.1      1.1.2    
fake_async                    *1.3.1      *1.3.1      *1.3.1      1.3.2    
leak_tracker                  *10.0.7     *10.0.7     *10.0.7     10.0.8   
leak_tracker_flutter_testing  *3.0.8      *3.0.8      *3.0.8      3.0.9    
matcher                       *0.12.16+1  *0.12.16+1  *0.12.16+1  0.12.17  
source_span                   *1.10.0     *1.10.0     *1.10.0     1.10.1   
stack_trace                   *1.12.0     *1.12.0     *1.12.0     1.12.1   
stream_channel                *2.1.2      *2.1.2      *2.1.2      2.1.4    
string_scanner                *1.3.0      *1.3.0      *1.3.0      1.4.1    
term_glyph                    *1.2.1      *1.2.1      *1.2.1      1.2.2    
test_api                      *0.7.3      *0.7.3      *0.7.3      0.7.4    
vm_service                    *14.3.0     *14.3.0     *14.3.0     15.0.0   
all dependencies are up-to-date.

What is happening???

转载请注明原文地址:http://anycun.com/QandA/1745852258a91234.html