0

I built a flutter plugin that supports iOS 13 and it works fine. Now I'm trying to update the iOS support to be from 12 and I'm running into issues. I have updated the Podfile in the example project to be: platform :ios, '12.0'. I have also have updated the .podspec file in ios folder of the plugin as well: s.platform = :ios, '12.0'. The classes in the ios folder are called:

SdkSdcFlutterPlugin.h
SdkSdcFlutterPlugin.m
SwiftSdkSdcFlutterPlugin.swift

When i try to build I get the following error on the .m file:

Unknown receiver 'SwiftSdkSdcFlutterPlugin'; did you mean 'SdkSdcFlutterPlugin'?
Replace 'SwiftSdkSdcFlutterPlugin' with 'SdkSdcFlutterPlugin''?

The .m file is auto generated and worked fine for iOS 13 and looks lie this:

#import "SdkSdcFlutterPlugin.h"
#if __has_include(<sdk_sdc_flutter/sdk_sdc_flutter-Swift.h>)
#import <sdk_sdc_flutter/sdk_sdc_flutter-Swift.h>
#else
// Support project import fallback if the generated compatibility header
// is not copied when this plugin is created as a library.
// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816
#import "sdk_sdc_flutter-Swift.h"
#endif

@implementation SdkSdcFlutterPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
  [SwiftSdkSdcFlutterPlugin registerWithRegistrar:registrar];
}
@end

The iOS version feels unrelated yet when I revert the changes it works, I am also using 3.10.6 flutter stable version.

Thanks!

Shai Herman
  • 126
  • 9

0 Answers0