AngeloAvv / flutter_flavorizr

A flutter utility to easily create flavors in your flutter application
https://pub.dev/packages/flutter_flavorizr
MIT License
468 stars 85 forks source link

Xcode <Flutter/Flutter.h> file not found, after adding Extension to project #197

Open haphu4247 opened 1 year ago

haphu4247 commented 1 year ago

i met a problem with adding extension in ios.

/Users/abc/Desktop/practice/test_adding_extension/ios/Runner/GeneratedPluginRegistrant.h:10:9 'Flutter/Flutter.h' file not found

haphu4247 commented 1 year ago

i FOUND OUT THE WAY TO RESOLVE IT.

in XCODE, the Extension is an independent module in ios project. so when adding an extension to ios project, the Extension Target SHOULD NOT REFERENCE to the Runner (TARGET_NAME). that reason why the error occurs when building project.

how to fix: remove SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h" in buildSettings of Extension

Screenshot 2023-07-31 at 10 41 36 AM
khalidrinaldy commented 9 months ago

i FOUND OUT THE WAY TO RESOLVE IT.

in XCODE, the Extension is an independent module in ios project. so when adding an extension to ios project, the Extension Target SHOULD NOT REFERENCE to the Runner (TARGET_NAME). that reason why the error occurs when building project.

how to fix: remove SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h" in buildSettings of Extension Screenshot 2023-07-31 at 10 41 36 AM

Hello, I solved the issue with this approach. It can run, but failed after that because the extension cannot find its NSExtension. May I see your NotificationService Info.plist ?

This is the error

image

This is the extension's info.plist

image
icodelifee commented 3 months ago

i FOUND OUT THE WAY TO RESOLVE IT. in XCODE, the Extension is an independent module in ios project. so when adding an extension to ios project, the Extension Target SHOULD NOT REFERENCE to the Runner (TARGET_NAME). that reason why the error occurs when building project. how to fix: remove SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h" in buildSettings of Extension Screenshot 2023-07-31 at 10 41 36 AM

Hello, I solved the issue with this approach. It can run, but failed after that because the extension cannot find its NSExtension. May I see your NotificationService Info.plist ?

This is the error image

This is the extension's info.plist image

Just like how you cleared Building Headers, also clear Targets -> Extension -> Build Settings -> Linking General -> Other Linker Flags