magillus / flutter-fimber

Fimber is Flutter logger inspired by Timber (logger API for Android)
106 stars 22 forks source link

[flutter_fimber] Semantic Issue (Xcode): Duplicate interface definition for class 'FlutterFimberPlugin' #133

Closed diegotori closed 1 year ago

diegotori commented 1 year ago

Looks like you're declaring the same ios plugin implementation more than once, thus causing it to fail to build for iOS when using flutter_fimber, version 0.7.0.

I noticed that there are two competing implementations in that folder, FlutterFimberPlugin.swift and SwiftFlutterFimberPlugin.swift. Ideally they should be consolidated into an Objective-C header and main file that bootstraps just SwiftFlutterFimberPlugin.swift.

FlutterFimberPlugin.h

#import <Flutter/Flutter.h>

@interface FlutterFimberPlugin : NSObject<FlutterPlugin>
@end

FlutterFimberPlugin.m

#import "FlutterFimberPlugin.h"
#import <flutter_fimber/flutter_fimber-Swift.h>

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

Then delete FlutterFimberPlugin.swift. Hopefully this can be addressed quickly since I had to remove this dependency in order to get iOS building again.

Also, if you're working on actual iOS support, please consider adding it in a separate branch and within the ios folder, not the example/ios folder. When you add it there, you're competing against the former, where your iOS platform channel implementation should live and will be accessible from your example app anyways.

Thank you in advance.

magillus commented 1 year ago

Thanks for hint, I am not iOS dev. I appreciate any help on this. I need to fix this at some point.

diegotori commented 1 year ago

@magillus I pretty much gave you the answer. Remove the plugin declaration from example/ios and fix the existing ios folder as per the original post.

magillus commented 1 year ago

I spend few hours trying to get that done and still my mac with xcode gives me pod error. 🙄