Seong Jun
Seong Jun

Reputation: 183

How can I fix Flutter_localizations error on the vscode? - Target of URI doesn't exist

I'm trying to use flutter_localizations and I followed this guide

When I save pubspec.yaml on vscode then pub get is ran.

After that vscode can't find app_localizations.dart file.

But this error messages will disappear when I reopen vscode.

Is there anyone with such a problem like me?

Thanks.

AppLocalizations Error

Upvotes: 2

Views: 1516

Answers (2)

croxx5f
croxx5f

Reputation: 5733

Usually running

flutter gen-l10n

should be enough, however sometimes I'va found myself using

flutter clean && flutter pub get dependencies && flutter packages get

To clean cache, and get the dependencies(which also generate the l10n). 95% of the time the first command should suffice

Upvotes: 2

Seong Jun
Seong Jun

Reputation: 183

Use this command and Open command palette - command + shift + p on the vscode.

Type Dart: Restart Analysis Server and select it.

This error will be gone.

Upvotes: 6

Related Questions