when I try to add libraries in which cache images from server like :
cached_network_image
flutter_advanced_networkimage
the lib download to lib folder but project can't be build and show error:
Invalid plugin specification path_provider_windows.
Invalid "windows" plugin specification.
here is my pubspec.yaml
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
get_it: ^2.0.1
flutter_bloc: ^4.0.0
equatable: ^0.4.0
dartz: ^0.8.6
data_connection_checker: ^0.3.4
dio: ^3.0.10
shared_preferences: ^0.5.3+4
image_picker: ^0.6.7
#flutter_advanced_networkimage: ^0.7.0
#cached_network_image: ^2.3.2+1
google_maps_flutter: ^0.5.28+1
permission_handler: ^5.0.0+hotfix.8
url_launcher: ^5.4.10
mailto: ^0.2.0+1
shamsi_date: ^0.9.0
firebase_core: ^0.4.0+9
firebase_analytics: ^5.0.2
firebase_messaging: ^6.0.16
firebase_crashlytics: ^0.1.3+3
dev_dependencies:
flutter_test:
sdk: flutter
gen_lang: 0.1.3
mockito: ^4.1.0
flutter_launcher_icons: "^0.7.3"
This isn't technically me answering the question however the dev team have picked up on this issue and they are in the process of fixing it
Here is the github link to their fix: https://github.com/flutter/flutter/issues/66158
EDIT:
According to the issue logged on Github a fix would be to pub upgrade which would theoretically upgrade you to the latest working version of path_provider, not sure if this works though I have yet to try it myself
Related
I upgraded flutter and dart recently and unexpectedly encountered this error. Everything was fine, I just re-started the project and the error was there!
Error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
My pubspec.yml dependencies:
dependencies:
auto_animated: any
awesome_dialog: ^2.1.1
cached_network_image: ^3.0.0
carousel_slider: ^3.0.0
circular_countdown_timer: ^0.2.0
cupertino_icons: ^1.0.0
dropdown_search: ^2.0.1
dropdownfield: ^1.0.3
email_validator: ^2.0.1
expandable: ^5.0.1
firebase_core: ^1.10.2
firebase_messaging: ^11.2.0
flutter:
sdk: flutter
flutter_animator: ^3.2.0
flutter_html: ^0.8.2
flutter_launcher_icons: any
flutter_local_notifications: ^6.0.0
flutter_spinkit: ^5.0.0
flutter_tags: ^0.4.9+1
flutter_zoom_drawer: ^2.1.1
google_fonts: any
http: ^0.13.1
image: ^3.0.2
image_picker: ^0.7.4
image_size_getter: ^1.0.0
intl: ^0.17.0
material_design_icons_flutter: 4.0.5955
mime: ^1.0.0
page_transition: ^1.0.9
progress_indicators: ^1.0.0
provider: ^6.0.1
shared_preferences: ^2.0.6
swipe_cards: ^0.1.0
syncfusion_flutter_datepicker: ^19.3.56
textfield_tags: ^1.1.1
upgrader: ^3.3.0
url_launcher: ^6.0.3
webview_flutter: ^0.3.0
path_provider: ^2.0.1
open_file: ^3.1.0
What I've tried:
flutter upgrade
Flutter clean and flutter get
Changing min SDK version
The problem was solved after I reinstalled flutter and created a project from scratch and copied my older code. Also, Firebase is now only compatible if you have the min SDK version of 19.
I solved it by upgrading the AndroidStudio Version,It maybe caused by the low version of development tool,
I have a problem on matters upgrader, it's seems i can't build my apps when it come to difference version off package
here is the problem
Running "flutter pub get" in Mobile7Merge...
Because requests 3.3.0 depends on shared_preferences ^0.5.2 and no versions of requests match >3.3.0 <4.0.0, requests ^3.3.0 requires shared_preferences ^0.5.2.
So, because mobile7 depends on both requests ^3.3.0 and shared_preferences ^2.0.3, version solving failed.
pub get failed (1; So, because mobile7 depends on both requests ^3.3.0 and shared_preferences ^2.0.3, version solving failed.)
here is my pubspec.yaml
name: mobile7
description: Mobile 7
version: 1.0.0+1
environment:
sdk: ">=2.5.2 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
http: ^0.12.1
lazy_load_scrollview: ^1.1.0
flutter_appauth: ^0.9.1
flutter_secure_storage: ^3.3.3
fl_chart: ^0.10.1
flutter_datetime_picker: ^1.3.8
intl: ^0.16.1
google_nav_bar: ^2.2.0
line_icons: ^0.2.0
google_fonts: ^1.1.0
equatable: ^1.2.5
bloc: ^6.0.3
flutter_bloc: ^6.0.5
rxdart: ^0.23.1
expandable: ^4.1.4
jiffy: ^3.0.1
requests: ^3.3.0
flutter_html: ^1.0.0
webview_flutter: any
flutter_downloader: ^1.4.4
path_provider: ^1.6.24
permission_handler: ^5.0.1
fluttertoast: ^7.1.1
# flutter_cached_pdfview: ^0.3.0
# flutter_pdfview: ^1.0.0+10
upgrader: ^3.0.0
dio: any
advance_pdf_viewer: ^1.2.0
pinch_zoom: ^0.0.4
dart_date: ^1.0.7
flutter_inappwebview: ^4.0.0+4
shared_preferences: ^2.0.3
# shared_preferences: ^0.5.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- images/
I thought to have two package at the same time, that is 2.0.3 and 0.5.2 but either any of them have solve my problem, i tried to search if i can use two package with the same name but mainly, thos shared_preference are inside request package and upgrader package, i tried to include there on my own
How can i solve this??
Managing dependencies can be a pain some times but I have found this commands can be useful:
flutter pub outdated https://dart.dev/tools/pub/cmd/pub-outdated
flutter pub upgrade --major-versions https://dart.dev/tools/pub/cmd/pub-upgrade#--major-versions
Details about issue : Because every version of flutter_driver from sdk depends on process 4.0.0-nullsafety.2 which depends on platform ^3.0.0-nullsafety.1, every version of flutter_driver from sdk requires platform ^3.0.0-nullsafety.1.
And because firebase_messaging >=0.2.0 <7.0.2 depends on platform ^2.0.0, flutter_driver from sdk is incompatible with firebase_messaging >=0.2.0 <7.0.2.
So, because receiptree depends on both firebase_messaging ^6.0.13 and flutter_driver any from sdk, version solving failed.
Running "flutter pub get" in working...
pub get failed (1; So, because xxxx depends on both firebase_messaging ^6.0.13 and flutter_driver any from sdk, version solving failed.)
Please help me to format below code
version: 0.9.9-beta+9
environment:
sdk: ">=2.7.0 <3.0.0"
depedencies:
Auth
firebase_auth: ^0.15.5+3
google_sign_in: ^4.4.0
flutter_facebook_login: ^3.0.0
apple_sign_in: ^0.1.0
Notification
firebase_messaging: ^6.0.13
firebase_dynamic_links: ^0.5.0+11
fluttertoast: ^4.0.1
Core
provider: ^4.0.4
auto_route: ^0.4.2
flutter_mobx: ^1.1.0
mobx: ^1.1.1
mobx_codegen: ^1.0.3
firebase_ml_vision: ^0.9.3+8
Dependency injection
inject:
git:
url: https://github.com/google/inject.dart.git
path: package/inject
ref: 7c3cbf6
Storage
shared_preferences: ^0.5.6+3
firebase_storage: ^3.1.5
cloud_firestore: ^0.13.4+2
UI
photo_view: ^0.9.2
flutter_page_indicator: 0.0.3
datetime_picker_formfield: ^1.0.0
image_picker: ^0.6.4
flutter_datetime_picker: ^1.4.0
image_cropper: ^1.2.1
flutter_typeahead: ^1.8.0
flutter_masked_text: ^0.8.0
video_player: null
Utility
flutter_svg: ^0.18.1
flutter_image_compress: ^0.6.5+1
firebase_analytics: ^5.0.11
firebase_crashlytics: ^0.1.3+3
package_info: ^0.4.0+16
http: ^0.12.2
dartz: ^0.9.1
faker: ^1.2.1
intl: ^0.16.1
printing: ^3.6.0
image_gallery_saver: ^1.5.0
dio: ^3.0.10
flutter_email_sender: ^3.0.1
Unknown
path_provider: ^1.6.5
flutter:
sdk: flutter
The following adds the Cupertino Icons font to your application.
Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
random_string: ^2.1.0
permission_handler: ^5.0.1+1
share: ^0.6.5+2
url_launcher: ^5.7.1
dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^4.1.1
flutter_driver:
sdk: flutter
test: any
timeago: ^2.0.26
flutter_launcher_icons: ^0.8.0
auto_route_generator: ^0.4.0
build_runner: null
inject_generator:
git:
url: https://github.com/google/inject.dart.git
path: package/inject_generator
ref: 7c3cbf6
I faced the same problem. The problem is coming from firebase messaging.
Currently, you have:
firebase_messaging: ^6.0.13
which limits firebase messaging to a version 6.
Replace it with
firebase_messaging: ^7.0.0
And it should solve your issue.
I can't import the firebase_auth package in Flutter. I did everything they said in the installation part (as shown below). Other packages are imported and working properly, but firebase_auth isn't.
name: flash_chat
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.1.0<3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
animated_text_kit: ^2.2.0
firebase_core: ^0.5.0
firebase_auth_platform_interface: ^2.0.1
firebase_auth_web: ^0.3.0+1
firebase_core_platform_interface: ^2.0.0
cloud_firestore: ^0.14.0+2
firebase_analytics: ^6.0.0
firebase_messaging: ^7.0.0
firebase_auth: ^0.18.0+1
dev_dependencies:
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- images/
And I did the pub get. Can anybody help me?
These are a few suggested solutions:
Reload your IDE
Delete your pubspec.lock file and re run pub get.
I have just upgraded my flutter version and now I am facing the following issue when I get the packages in pubsec.yml file:
Because every version of flutter_test from sdk depends on image 2.1.4 and Instant_Feedback depends on image ^2.1.9, flutter_test from sdk is forbidden.
So, because Instant_Feedback depends on flutter_test any from sdk,
version solving failed. pub get failed (1; So, because
Instant_Feedback depends on flutter_test any from sdk, version solving
failed.)
My pubsec.yml file
dependencies:
flutter:
sdk: flutter
http: ^0.12.0+2
shared_preferences: ^0.5.4+8
firebase_messaging: ^6.0.3
flutter_crashlytics: ^1.0.0
firebase_core: ^0.4.2+1
cupertino_icons: ^0.1.3
device_calendar: ^1.0.0+2
cloud_firestore: ^0.12.11
auto_size_text: ^2.1.0
flutter_expandable_menu: ^0.0.1
webview_flutter: ^0.3.17
flutter_spinkit: ^4.1.1+1
get_it: 2.1.0
bloc: ^0.15.0
flutter_bloc: 0.21.0
equatable: 0.5.1
rflutter_alert: ^1.0.3
expandable: ^3.0.1
connectivity: ^0.4.6
firebase_auth: ^0.15.1
flutter_email_sender: ^2.2.1
mockito: 4.1.1
flutter_secure_storage: ^3.3.1+1
image_picker: ^0.6.2+2
async: any
image: ^2.1.10
image_crop: ^0.3.1
flutter_cache_manager: ^1.1.3
circular_profile_avatar: ^1.0.3
package_info: ^0.4.0+12
flutter_local_notifications: ^0.8.4+3
flutter_webview_plugin: ^0.3.10
url_launcher: ^5.2.7
flutter_localizations:
sdk: flutter
flutter_cupertino_localizations: ^1.0.1
dev_dependencies:
flutter_driver:
sdk: flutter
test: any
ozzie: 2.0.1
flutter_test:
sdk: flutter
flutter:
uses-material-design: true
assets:
- lib/app/assets/images/
- lib/app/assets/flags/
- lang/en.json
- lang/de.json
Because every version of flutter_test from sdk depends on image 2.1.4 and Instant_Feedback depends on image ^2.1.9, flutter_test from sdk is forbidden.
I faced the same issue. Couldn't find the specific reason for the flutter_test depending on a specific version of this image library. Maybe it's an issue from the flutter side. So here are some workaround solutions:
comment out the flutter_test dev_dependency.
dev_dependencies:
# flutter_test:
# sdk: flutter
set the required version.
Instead of 2.1.12, I set the Image package version to 2.1.4 (as requested in the error message)
image: ^2.1.4
If more than one packages versions are noncompatible to each other, and you don't know their exact compatible version, you can find it by setting both the conflicting dependencies to any, e.g.
flutter_crashlytics: any
firebase_core: any
This will automatically figure out the compatible package version. Check these new compatible versions in pubspec.lock file, which will be auto-generated by running flutter package get.
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
packages:
flutter_crashlytics:
...
version: "1.0.0"
firebase_core:
...
version: "0.4.2+1"
Replace any with those correct versions.
flutter_crashlytics: 1.0.0
firebase_core: 0.4.2+1
Note: You should never leave your versions as any