You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can happen if the method is not supported by the current OS version.
ffigened implement/implementAsListener calls objc.getProtocolMethodSignature even for functions that are not installed.
e.g.
abstractfinalclassNSStreamDelegate {
/// Builds an object that implements the NSStreamDelegate protocol. To implement /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly.static objc.ObjCObjectBaseimplement(
{voidFunction(NSStream, NSStreamEvent)? stream_handleEvent_}) {
final builder = objc.ObjCProtocolBuilder();
NSStreamDelegate.stream_handleEvent_
.implement(builder, stream_handleEvent_); // `NSStreamDelegate.stream_handleEvent_` will be loaded even if `stream_handleEvent_` is `null`return builder.build();
}
}
I think that there are two things to do here:
Don't call getProtocolMethodSignature when the signature isn't needed
getProtocolMethodSignature should provide better diagnostics e.g.
objc.NSMethodSignaturegetProtocolMethodSignature(
Pointer<c.ObjCProtocol> protocol,
Pointer<c.ObjCSelector> sel, {
requiredbool isRequired,
requiredbool isInstanceMethod,
}) {
final sig =
c.getMethodDescription(protocol, sel, isRequired, isInstanceMethod).types;
if (sig == nullptr) {
throwSelectorNotSupportedException(
'Failed to load method of Objective-C protocol: ${protocol.toDartString()} ${sel.toDartString()}');
}
The text was updated successfully, but these errors were encountered:
This can happen if the method is not supported by the current OS version.
ffigen
edimplement
/implementAsListener
callsobjc.getProtocolMethodSignature
even for functions that are not installed.e.g.
I think that there are two things to do here:
getProtocolMethodSignature
when the signature isn't neededgetProtocolMethodSignature
should provide better diagnostics e.g.The text was updated successfully, but these errors were encountered: