moovida / dart_jts

An effort to port some of the Java Topology Suite to dart
Other
26 stars 19 forks source link

dart_jts build issues with flutter 3.0 #12

Closed iulian0512 closed 2 years ago

iulian0512 commented 2 years ago

Because dart_jts 0.2.1 depends on collection >=1.14.13 <=1.15.0 and no versions of dart_jts match >0.2.1 <0.3.0, dart_jts ^0.2.1 requires collection >=1.14.13 <=1.15.0. And because every version of flutter_test from sdk depends on collection 1.16.0, dart_jts ^0.2.1 is incompatible with flutter_test from sdk.

sanak commented 2 years ago

The following SMASH side issue's error is quite similar with above error. https://github.com/geopaparazzi/smash/issues/186

In this repository, I got the following error.

% flutter pub get
Running "flutter pub get" in dart_jts...                            6.7s
Because every version of flutter from sdk depends on collection 1.16.0 and every version of dart_jts from path depends on collection >=1.14.13 <=1.15.0, flutter from sdk is incompatible with dart_jts from path.
So, because dartjtsexample depends on both dart_jts from path and flutter from sdk, version solving failed.
Running "flutter pub get" in example...                                 
pub get failed (1; So, because dartjtsexample depends on both dart_jts from path
and flutter from sdk, version solving failed.)

And the following change (just increments max version) seems to be enough.

--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -10,7 +10,7 @@ environment:

 dependencies:
   intl: '>=0.16.1 <=0.17.0'
-  collection: '>=1.14.13 <=1.15.0'
+  collection: '>=1.14.13 <=1.16.0'

 dev_dependencies:
   pedantic: ^1.9.0
% flutter pub get
Running "flutter pub get" in dart_jts...                         2,611ms
Running "flutter pub get" in example...                             4.0s
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate
this app to the V2 embedding.
Take a look at the docs for migrating an app:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

% flutter test
00:05 +329: All tests passed!
moovida commented 2 years ago

Hi there, yes, I am currently abroad, but this needs to be a migration for all the SMASH upstream projects, so it will need some time to do it all together. I will look into it soon though.

sanak commented 2 years ago

@moovida Okay, thanks for the confirmation!

sanak commented 2 years ago

@moovida Thanks! I confirmed that flutter pub get and flutter test on the latest master branch works without the error.

iulian0512 commented 2 years ago

@moovida thanks for the fix