언어·프레임워크/Flutter

[Flutter] fluttertoast 라이브러리 사용시 만난 에러(error)

DandyNow 2022. 1. 20. 23:56
728x90
반응형

Error: Cannot run with sound null safety, because the following dependencies

The plugin `fluttertoast` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

Launching lib\main.dart on Android SDK built for x86 in debug mode...

lib\main.dart:1
Error: Cannot run with sound null safety, because the following dependencies

don't support null safety:


- package:fluttertoast

 

fluttertoast 라이브러리를 사용할 때 위와 같은 에러를 만났다.

구글링 끝에 아래의 방법으로 해결하였다.

 


 

Flutter Run Additional Args에 "--no-sound-null-safety" 추가하여 해결

 

Manage → Settings →

 

→ Flutter Run Additional Args 검색 → Add Item

 

VS Code에서는 Manage → Settings → "Flutter Run Additional Args" 검색 → Add Item 클릭 후 아래의 내용을 추가하면 해결된다.

--no-sound-null-safety

 

728x90
반응형