提问人:DineshkumarBalan 提问时间:10/3/2023 更新时间:10/4/2023 访问量:67
Flutter : geolocator dependecy issues - 构建错误
Flutter : geolocator dependecy issues - Build error
问:
我在构建我的 flutter 应用程序本身时收到以下错误。
C:\Users\Admin\AppData\Local\Pub\Cache\hosted\pub.dev\geolocator_android-4.2.2\android\src\main\java\com\baseflow\geolocator\location\FusedLocationClient.java:91: error: cannot find symbol
LocationRequest.Builder builder = new LocationRequest.Builder(0);
^
symbol: class Builder
location: class LocationRequest
C:\Users\Admin\AppData\Local\Pub\Cache\hosted\pub.dev\geolocator_android-4.2.2\android\src\main\java\com\baseflow\geolocator\location\FusedLocationClient.java:91: error: cannot find symbol
LocationRequest.Builder builder = new LocationRequest.Builder(0);
^
symbol: class Builder
location: class LocationRequest
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':geolocator_android:compileDebugJavaWithJavac'.
我在pubspec.yaml中使用了以下环境设置
environment:
sdk: ">=2.16.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.5
get: ^4.6.5
google_fonts: ^4.0.4
lottie: ^1.4.2
dob_input_field: ^2.0.0
intl: ^0.17.0
google_maps_flutter: ^2.2.3
google_maps_flutter_web: ^0.4.0+5
fluttertoast: ^8.2.1
geocoding: ^2.0.5
geocoder2: ^1.4.0
flutter_polyline_points: ^1.0.0
booking_calendar: ^1.1.9
dropdown_button2: ^1.4.0
intl_phone_field: ^3.1.0
dropdown_textfield: ^1.0.1
json_annotation: ^4.6.0
dio: ^4.0.1
retrofit: ^3.0.1+1
retrofit_generator: ^4.0.1
_fe_analyzer_shared: ^40.0.0
logger: ^1.4.0
table_calendar: ^3.0.8
shared_preferences: ^2.0.17
location: ^4.4.0
image_picker: ^0.8.6
flutter_google_places: ^0.3.0
url_launcher: ^6.1.8
carousel_slider: ^4.2.1
barcode_scan2: ^4.2.4
paytm_allinonesdk: ^1.1.7
modal_bottom_sheet: ^2.0.1
webview_flutter: ^3.0.4
google_maps: ^6.2.0
permission_handler: ^11.0.0
flutter_dotenv: ^5.0.2
geolocator: ^9.0.2
flutter:
uses-material-design: true
assets:
- assets/
谁能建议我更改以解决此问题?
我已经修改了不同版本的地理定位器和地理编码以进行验证,但没有更改。
我也交叉验证了 flutter 论坛,许多开发人员都面临类似的问题,但没有找到解决方案。
答:
0赞
Depresif Amca
10/4/2023
#1
当您从终端运行“flutter clean”然后“flutter run”代码时,该问题应该得到解决。
评论
0赞
DineshkumarBalan
10/10/2023
已经尝试过甚至清除了 pub 缓存也 flutter pub 缓存修复但没有变化。
评论