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

Error when adding package to project. - Error: The argument type 'InternetAddress/*1*/' can't be assigned to the parameter type 'InternetAddress/*2*/' #83

Closed
Tmarks2a opened this issue Feb 23, 2023 · 5 comments

Comments

@Tmarks2a
Copy link

{user}/AppData/Local/Pub/Cache/hosted/pub.dev/network_tools-3.0.0+3/lib/src/mdns_scanner/mdns_scanner.dart:102:28: Error: The argument type 'InternetAddress/1/' can't be assigned to the parameter type 'InternetAddress/2/'.

  • 'InternetAddress/1/' is from 'dart:io'.
  • 'InternetAddress/2/' is from 'package:universal_io/src/internet_address.dart' ('/{user}/AppData/Local/Pub/Cache/hosted/pub.dev/universal_io-2.2.0/lib/src/internet_address.dart').
    internet_address.dart:1
    internetAddress: internetAddress,
@guyluz11
Copy link
Collaborator

guyluz11 commented Feb 26, 2023

Hi @Tmarks2a

I see that you are not running the last available version
From your log you are running network_tools-3.0.0+3 and the last version is 3.1.0 with updated specifically for the package that it fell on universal_io

Please test it with the new version and add the following info so that we will have more understanding of the crash.

What os and version did you run it on (Windows Linux android ...)
On what platform (Web, phone, native app)
Did it run on dart native or flutter
Does the previous version of the package have the same crash before we added universal_io?
How long did it take for the crash to happen?
What mDNS devices do you have in your local network?

@git-elliot
Copy link
Collaborator

Similar to this is dint-dev/universal_io#19

@guyluz11
Copy link
Collaborator

guyluz11 commented Mar 1, 2023

Similar to this is dint-dev/universal_io#19

Nice catch @git-elliot

Someone suggested there some work around, so if we can reproduce it it is another fix that we can take

@git-elliot
Copy link
Collaborator

@Tmarks2a I'm not able to reproduce this on latest version of network_tools and flutter. Snippet I tried running

  MdnsScanner.findingMdnsWithAddress("_airplay").then((value) {
      for (ActiveHost activeHost in value) {
        InternetAddress address = activeHost.internetAddress;
        print(address);
      }
    });

Not to forget InternetAddress can either be imported from universal_io/io.dart or dart:io. Code works for both imports.
main.dart.txt

@git-elliot
Copy link
Collaborator

Please reopen if still facing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants