-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/packages
#2851Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4Found to occur in 3.4has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Steps to Reproduce
Sample pigeon file:
import 'package:pigeon/pigeon.dart';
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/generated/test_api.dart',
swiftOut: 'ios/Runner/TestApi.swift',
),
)
@HostApi()
abstract class TestApi {
void test();
}Implementation in Swift:
class MyTestApi: NSObject, TestApi {
func test() {
print("test method called in swift")
}
}Usage in Flutter:
try {
await TestApi().test();
debugPrint('test method called');
} catch (e, stackTrace) {
debugPrint('Test method failed. $e $stackTrace');
}Expected results:
test method called is logged
Actual results:
Following is logged:
test method called in swift
flutter: Test method failed. PlatformException(channel-error, Unable to establish connection on channel., null, null) #0 TestApi.test
package:sk/generated/test_api.dart:30
flutter: <asynchronous suspension>
flutter: #1 _MainScreenState.build.<anonymous closure>
package:sk/…/main_screen/main_screen.dart:90
flutter: <asynchronous suspension>
flutter:
So method in Swift side is called, but handling the response on Flutter side by pigeon fails.
gaaclarke, tgrushka, VictorUvarov, daniloapr and red282
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consolefound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.4Found to occur in 3.4Found to occur in 3.4has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version