dart 运行分级中的意外元素

bzzcjhmw  于 2023-06-19  发布在  其他
关注(0)|答案(1)|浏览(81)

我目前正在Flutter 2.8.0版本上运行一个项目,在调试它时,我遇到了以下错误:

C:\Users\user\Downloads\flutter_windows_2.8.0-stable\flutter\.pub-cache\hosted\pub.dartlang.org\geolocator-6.2.1\android\src\main\java\com\baseflow\geolocator\location\LocationManagerClient.java:10: warning: [deprecation] LocationProvider in android.location has been deprecated
import android.location.LocationProvider;
                       ^
error: warnings found and -Werror specified
C:\Users\user\Downloads\flutter_windows_2.8.0-stable\flutter\.pub-cache\hosted\pub.dartlang.org\geolocator-6.2.1\android\src\main\java\com\baseflow\geolocator\location\LocationMapper.java:29: warning: [deprecation] isFromMockProvider() in Location has been deprecated
      position.put("is_mocked", location.isFromMockProvider());

我尝试更改Geolocation最新版本,但导致另一个错误。

1tuwyuhd

1tuwyuhd1#

运行这些命令

* flutter pub cache clean
* flutter clean
* flutter pub cache repair
* flutter pub get

更新***pubspec.yaml***文件中依赖项的最新版本。

相关问题