Comments (3)
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.
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.
@vladotesanovic can you try the fix from this commit and tell me if it helps?
from flutter_nsd.
Related Issues (20)
- Notify when service is lost HOT 5
- NetServiceBrowser is deprecated on iOS/MacOS
- Not getting any output from example app even though run shows servers HOT 3
- Windows: TXT records are returned as string instead of UInt8List, causing failure
- Windows: txt records are sent as [key: key] instead of [key: value] HOT 1
- Stream<NsdServiceInfo> doesn't add service If msdn server hass service txt is added HOT 5
- NsdServiceInfo Class should have IP HOT 3
- Any plans for Linux support? HOT 1
- The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher HOT 4
- stopDiscovery() stops, but generates an error HOT 2
- missing permission for some Android versions HOT 2
- Error on executing command 'flutter build windows' HOT 2
- stopDiscovery Not working giving below exception HOT 4
- Windows build is failing
- startDiscoveryFailed every time HOT 1
- MacOS and iOS not returning any hostAddress HOT 1
- getting NsdErrorCode.startDiscoveryFailed when hot restart app
- Services are not discovered on Android HOT 2
- On Android, the IP address is returned in the hostname field of NsdServiceInfo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_nsd.