justkawal / excel

Excel Library for Flutter and Dart - https://pub.dev/packages/excel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not compatible with flutter_test

akaenner opened this issue · comments

If I include excel in my project I get the following dependency error:

[MyApp] flutter pub get
Running "flutter pub get" in MyApp...
Because every version of flutter_test from sdk depends on xml 3.6.1 and excel >=1.0.4 depends on xml ^4.1.0, flutter_test from sdk is incompatible with excel >=1.0.4.
So, because Herein depends on both excel ^1.0.8 and flutter_test any from sdk, version solving failed.

pub get failed (1; So, because MyApp depends on both excel ^1.0.8 and flutter_test any from sdk, version solving failed.)
exit code 1

What should I do? I need both: tests and excel.

Use command : flutter update-packages --force-upgrade

Tell me if this works for you !

~Thank You
LONG LIVE OPEN S🔥URCE

Now I get a slightly different dependency error. Basically the same but the required version for flutter_test is now 3.7.0:

Because every version of flutter_test from sdk depends on xml 3.7.0 and excel >=1.0.4 depends on xml ^4.1.0, flutter_test from sdk is incompatible with excel >=1.0.4.

Here is my flutter doctor output:

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.2, on Mac OS X 10.15.4 19E287, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.45.1)
[✓] Connected device (2 available)

• No issues found!

Solved

Try below steps:

  1. Open project folder and remove excel dependency
  2. Add these lines in your project's pubspec.yaml
dependency_overrides:
  xml: ^4.1.0

after adding it will look like:

dev_dependencies:
  flutter_test:
    sdk: flutter

dependency_overrides:
  xml: ^4.1.0
  1. run flutter clean in the project folder.

  2. Close project folder

  3. Open terminal and run below commands :

    flutter upgrade

    pub cache repair

    flutter update-packages --force-upgrade

  4. Open project folder and add the dependency `excel:

Tell me if this works ?

We celebrate every issue as it helps us to improve.
~Thank You
LONG LIVE OPEN S🔥URCE

Thank you very much. This works :-)

Happy to help.
Stay Tuned...

More functionality is coming within next week with excel being more faster than now.