GithubHelp home page GithubHelp logo

Comments (3)

Nimrodda avatar Nimrodda commented on July 28, 2024

Thanks for the report. I need more info. What plugin version? Android version? When did it happen? Is this the full stacktrace? how to reproduce?

from flutter_nsd.

vladotesanovic avatar vladotesanovic commented on July 28, 2024

Hi Nimrodd,

Same problem to me:

Plugin version: Private fork based on current master branch ( because current 1.3.3 does not have kotlin_version update )
Android version: 13
Phone: Google Pixel 6

Code to repoduce ( basic example )

@override
  Widget build(BuildContext context, WidgetRef ref) {
    final site = ref.watch(getSiteProvider);
    final flutterNsd = FlutterNsd();
    flutterNsd.stream.listen((nsdServiceInfo) {
      print('Discovered service name: ${nsdServiceInfo.name}');
      print('Discovered service hostname/IP: ${nsdServiceInfo.hostname}');
      print('Discovered service port: ${nsdServiceInfo.port}');
    }, onError: (e) {
      if (e is NsdError) {
        // Check e.errorCode for the specific error
      }
    });

    void startDiscoveryButton() async {
      await flutterNsd.discoverServices('_lisa._tcp.local.');
    }
Where startDiscoveryButton is triggered by:
    TextButton(
            style: ButtonStyle(
              foregroundColor: MaterialStateProperty.all<Color>(Colors.blue),
              overlayColor: MaterialStateProperty.resolveWith<Color?>(
                (Set<MaterialState> states) {
                  if (states.contains(MaterialState.hovered))
                    return Colors.blue.withOpacity(0.04);
                  if (states.contains(MaterialState.focused) ||
                      states.contains(MaterialState.pressed))
                    return Colors.blue.withOpacity(0.12);
                  return null; // Defer to the widget's default.
                },
              ),
            ),
            onPressed: () {
              startDiscoveryButton();
            },
            child: Text('Discover'),
      Full stack trace:
          `E/AndroidRuntime(15051): FATAL EXCEPTION: NsdManager
E/AndroidRuntime(15051): Process: my.package.enduser.home, PID: 15051
E/AndroidRuntime(15051): java.lang.IllegalArgumentException: listener not registered
E/AndroidRuntime(15051): 	at android.net.nsd.NsdManager.getListenerKey(NsdManager.java:980)
E/AndroidRuntime(15051): 	at android.net.nsd.NsdManager.stopServiceDiscovery(NsdManager.java:1224)
E/AndroidRuntime(15051): 	at com.nimroddayan.flutternsd.FlutterNsdPlugin$discoveryListener$1.onStartDiscoveryFailed(FlutterNsdPlugin.kt:195)
E/AndroidRuntime(15051): 	at android.net.nsd.NsdManager$ServiceHandler.lambda$handleMessage$1(NsdManager.java:856)
E/AndroidRuntime(15051): 	at android.net.nsd.NsdManager$ServiceHandler$$ExternalSyntheticLambda9.run(Unknown Source:6)
E/AndroidRuntime(15051): 	at android.net.nsd.NsdManager$$ExternalSyntheticLambda0.execute(Unknown Source:0)
E/AndroidRuntime(15051): 	at android.net.nsd.NsdManager$ServiceHandler.handleMessage(NsdManager.java:856)
E/AndroidRuntime(15051): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(15051): 	at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(15051): 	at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(15051): 	at android.os.HandlerThread.run(HandlerThread.java:67)
I/Process (15051): Sending signal. PID: 15051 SIG: 9`

from flutter_nsd.

Nimrodda avatar Nimrodda commented on July 28, 2024

@vladotesanovic can you try the fix from this commit and tell me if it helps?

from flutter_nsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.