简体   繁体   中英

Error with adding dependencies in flutter

I ran into such a problem that when adding the get: dependency to flutter, nothing happens. And when importing

import 'pack:get/get.dart';

to the main file, the editor suggests adding this dependency, but the error " Cannot read property " pops up 'replace' of undefined".

Someone may have encountered a similar problem, how to fix it?

    name: flutter_application_1
    description: A new Flutter project.
    
    
    publish_to: 'none' # Remove this line if you wish to publish to pub.dev
    
    
    version: 1.0.0+1
    
    environment:
      sdk: ">=2.12.0 <3.0.0"
    
    
    dependency_overrides:
      flutter_web:
        git:
          url: https://github.com/flutter/flutter_web
          path: packages/flutter_web
      flutter_web_ui:
        git:
          url: https://github.com/flutter/flutter_web
          path: packages/flutter_web_ui
    dependencies:
      cupertino_icons: ^1.0.2
      flutter:
        sdk: flutter
    
    dev_dependencies:
    
      
      flutter_lints: ^1.0.0
      flutter_test:
        sdk: flutter
    
    
    flutter:
    
    
      uses-material-design: true

I got the same problem.

I guess it is because I have two version on my MacOS system, one is 1.60 and the other is 1.62, and when ver1.62 upgrade to 1.63 this issue happened.

Fix:

Uninstall both version and install ver1.60 ( https://code.visualstudio.com/updates/v1_60 ), the issue gone, then upgrade ver1.60 to ver1.63, and it gone too...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM