Home > Mobile >  Flutter-pub get showing error: ) was unexpected at this time
Flutter-pub get showing error: ) was unexpected at this time

Time:10-18

Every time I try running pub get or pub upgrade the following error is returned:[Working dir: C:\Users\User\AndroidStudioProjects\flutterr_app "C:\Program Files\Dart\dart-sdk\bin\pub.bat" get ) was unexpected at this time. Process finished with exit code 255][1]

[1]: https://i.stack.imgur.com/dv09t.jpg even if i try opening another project the error persists. The actual code is showing errors such as the ones below: [error: Target of URI doesn't exist: 'package:flutter/material.dart'. (uri_does_not_exist at [flutterr_app] lib\main.dart:1)][1]

[1]: https://i.stack.imgur.com/7pPRb.jpg I have tried changing the dart and android studio versions and even re-installing flutter but the problem is still there. Code in pubspec.yaml [1]: https://i.stack.imgur.com/W1e6z.jpg [2]: https://i.stack.imgur.com/tDDoT.jpg [3]: https://i.stack.imgur.com/TKShA.jpg

CodePudding user response:

In your project open terminal and write flutter pub get. it should remove all the errors. If not, share your pubspec.yaml code.

It's very common to have this error. Running flutter pub gets all the dependencies.

CodePudding user response:

Looks like a problem with your Dart SDK path. Open Android Studio, Go to File->Settings. Scroll down to bottom and select Language & Frameworks. Click on dart and share your Dart SDK path.

  • Related