Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue No named parameter with the name 'connectTimeout' #3255

Open
markjoseultra opened this issue Oct 1, 2024 · 5 comments
Open

Issue No named parameter with the name 'connectTimeout' #3255

markjoseultra opened this issue Oct 1, 2024 · 5 comments
Labels
bug Something isn't working package-drift_flutter Affects the drift_flutter utilities package

Comments

@markjoseultra
Copy link

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 markjoseultra changed the title Issue with amplify_storage_s3: 2.4.1 Issue No named parameter with the name 'connectTimeout' Oct 1, 2024
@simolus3 simolus3 added bug Something isn't working package-drift_flutter Affects the drift_flutter utilities package labels Oct 1, 2024
@simolus3
Copy link
Owner

simolus3 commented Oct 1, 2024

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

@markjoseultra
Copy link
Author

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.

@simolus3
Copy link
Owner

simolus3 commented Oct 1, 2024

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

@simolus3
Copy link
Owner

simolus3 commented Oct 1, 2024

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

@markjoseultra
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package-drift_flutter Affects the drift_flutter utilities package
Projects
None yet
Development

No branches or pull requests

2 participants