sebastianhaberey / nsd

Flutter Network Service Discovery (NSD) Plugin
61 stars 30 forks source link

nsd_android: Fix overload resolution ambiguity #64

Open joern-h opened 6 months ago

joern-h commented 6 months ago

Compiling for android fails. This PR fixes that.

$ flutter build apk

e: ~/.pub-cache/hosted/pub.dev/nsd_android-2.0.0/android/src/main/kotlin/com/haberey/flutter/nsd_android/Serialization.kt: (90, 17): Overload resolution ambiguity: 
public open fun setAttribute(key: String!, value: ByteArray!): Unit defined in android.net.nsd.NsdServiceInfo
public open fun setAttribute(key: String!, value: String!): Unit defined in android.net.nsd.NsdServiceInfo

FAILURE: Build failed with an exception.
sebastianhaberey commented 6 months ago

Hi @joern-h thanks for the PR. I cannot find this new setAttribute() signature in the documentation - am I overlooking something here?

joern-h commented 6 months ago

Thank you for looking at this. After looking at the implementation of NsdServiceInfo, I realized that the signature is hidden. Since I work on a lot of platform applications at work, I use a patched framework.jar that allows me to work with them. So I suspect this issue will only affect me.

I would appreciate it if you could merge the PR as it has no impact on other users, but I would also understand if you don't want to.

sebastianhaberey commented 5 months ago

Sorry for not answering I'm actually not against this, just don't have the time :/