drift icon indicating copy to clipboard operation
drift copied to clipboard

Issue No named parameter with the name 'connectTimeout'

Open markjoseultra opened this issue 1 year ago • 5 comments

Describe the bug

I am getting this error log when adding amplify_storage_s3: ^2.4.1

Launching lib\main.dart on sdk gphone x86 in debug mode... ../../../AppData/Local/Pub/Cache/hosted/pub.dev/drift_flutter-0.2.0/lib/src/native.dart:61:42: Error: No named parameter with the name 'connectTimeout'. return await isolate.connect(connectTimeout: connectTimeout); ^^^^^^^^^^^^^^ ../../../AppData/Local/Pub/Cache/hosted/pub.dev/drift_flutter-0.2.0/lib/src/native.dart:112:7: Error: No named parameter with the name 'port'. port: connections, ^^^^ ../../../AppData/Local/Pub/Cache/hosted/pub.dev/drift-2.18.0/lib/isolate.dart:178:11: Context: Found this candidate, but the arguments don't match. factory DriftIsolate.inCurrent(DatabaseOpener opener, ^^^^^^^^^ Target kernel_snapshot_program failed: Exception 2

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1

I have created a sample project to replicate the problem I just added amplify_storage_s3: ^2.4.1 and the error above happened if you could teach me a fix that would be great TIA. https://github.com/markjoseultra/flutter_drift_test

markjoseultra avatar Oct 01 '24 12:10 markjoseultra

Despite claiming to support older drift versions - drift_flutter actually requires a more recent version of the core drift package. This will be fixed in the next drift version, but that won't help you if you have another package depending on older drift versions (like Amplify).

Does adding this to your pubspec solve the issue?

dependency_overrides:
  drift: ^2.20.3

simolus3 avatar Oct 01 '24 15:10 simolus3

I will not be able to use the latest version of drift Because no versions of location match >7.0.0 <8.0.0 and location 7.0.0 depends on location_web ^5.0.3, location ^7.0.0 requires location_web ^5.0.3. And because no versions of location_web match >5.0.3 <6.0.0, location ^7.0.0 requires location_web 5.0.3. And because location_web 5.0.3 depends on web ^0.5.1 and drift >=2.19.2 depends on web ^1.0.0, location ^7.0.0 is incompatible with drift >=2.19.2. So, because flexiform depends on both drift ^2.20.3 and location ^7.0.0, version solving failed.

markjoseultra avatar Oct 01 '24 15:10 markjoseultra

Judging by the few changes required in https://github.com/Lyokone/flutterlocation/pull/989, you might get away with also adding web: ^1.0.0 to the dependency overrides section.

simolus3 avatar Oct 01 '24 15:10 simolus3

If you can't use the latest drift, try downgrading drift_flutter by using drift_flutter: '>=0.1.0 <0.2.0'

simolus3 avatar Oct 01 '24 15:10 simolus3

I can't also use drift_flutter 0.1.0

Because amplify_db_common_dart 0.4.6 depends on sqlite3 >=2.0.0 <2.4.3 and no versions of amplify_db_common_dart match >0.4.6 <0.5.0, amplify_db_common_dart ^0.4.6 requires sqlite3 >=2.0.0 <2.4.3. And because drift_flutter <0.2.0 depends on sqlite3 ^2.4.4, drift_flutter <0.2.0 is incompatible with amplify_db_common_dart ^0.4.6. And because amplify_storage_s3_dart 0.4.5 depends on amplify_db_common_dart ^0.4.6 and no versions of amplify_storage_s3_dart match >0.4.5 <0.5.0, drift_flutter <0.2.0 is incompatible with amplify_storage_s3_dart ^0.4.5. And because amplify_storage_s3 2.4.1 depends on amplify_storage_s3_dart ^0.4.5 and no versions of amplify_storage_s3 match >2.4.1 <3.0.0, drift_flutter <0.2.0 is incompatible with amplify_storage_s3 ^2.4.1. So, because flexiform depends on both amplify_storage_s3 ^2.4.1 and drift_flutter ^0.1.0, version solving failed.

markjoseultra avatar Oct 02 '24 06:10 markjoseultra

Closing as an amplify-related issue, there's not much we can do about this unfortunately :(

simolus3 avatar Dec 24 '24 13:12 simolus3