-
Notifications
You must be signed in to change notification settings - Fork 288
Closed
Description
Description
iOS build fails when using record: ^6.2.0 due to a method signature mismatch in record_linux 1.2.1.
Error
../../../.pub-cache/hosted/pub.dev/record_linux-1.2.1/lib/record_linux.dart:45:16: Error: The method 'RecordLinux.hasPermission' has fewer named arguments than those of overridden method 'RecordMethodChannelPlatformInterface.hasPermission'.
Future<bool> hasPermission(String recorderId) {
^
Why does Linux code affect iOS builds?
Flutter compiles all platform Dart code together during the build process, regardless of the target platform. This means:
- When building for iOS, Flutter still compiles
record_linuxDart code - The Dart analyzer checks method signatures across all platform implementations
- Even though Linux code won't run on iOS, it must still compile without errors
This is why a bug in record_linux breaks iOS builds, even though the Linux platform code is never executed on iOS devices.
Root Cause
record_linux 1.3.0was released 3 days ago with an updatedhasPermission()method signature (addedrequestparameter)record 6.2.0still depends onrecord_linux 1.2.1- The old version has a method signature that doesn't match the platform interface
Workaround
Add this to pubspec.yaml:
dependency_overrides:
record_linux: 1.3.0 # Fix iOS build errorSolution
Please update the record_linux dependency in record/pubspec.yaml from ^1.2.1 to ^1.3.0 and release a new version.
Environment
- Flutter: 3.32.0
- record: 6.2.0
- record_linux: 1.2.1 (breaks) / 1.3.0 (works)
- Platform: iOS build (but affects all platforms due to Dart compilation)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels