Closed tianxiawoyougood closed 1 year ago
Thank you for your contribution. I don't really understand the issue.
If i create a new flutter plugin with the official Flutter template, it generates the exact same registrar file as now present:
#import "Testplugin2Plugin.h"
#if __has_include(<testplugin2/testplugin2-Swift.h>)
#import <testplugin2/testplugin2-Swift.h>
#else
#import "testplugin2-Swift.h"
#endif
@implementation Testplugin2Plugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
[SwiftTestplugin2Plugin registerWithRegistrar:registrar];
}
@end
Yes. However, it causes a crash. I submitted this issue to Flutter official. https://github.com/flutter/flutter/issues/115560#issuecomment-1336674541
I'm first waiting for the answer on the official ticket before merging this.
In ios 14+, debug mode Flutter apps can only be launched from Flutter tooling, IDEs with Flutter plugins or from Xcode. So, registrar will be nil. However, we can't make it crash in its own plugin.