Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
haphu4247 opened this issue Jul 31, 2023 · 2 comments

Comments

@haphu4247
Copy link

i met a problem with adding extension in ios.

  • the Extension build failed with error:
    failed to emit precompiled header '/Users/abc/Library/Developer/Xcode/DerivedData/Runner-bvirpnxqsoxfpjdpqnyargnrgjqa/Build/Intermediates.noindex/PrecompiledHeaders/Runner-Bridging-Header-swift_1HWKR7Y3YIO2T-clang_2Q7Q0RSIRDI04.pch' for bridging header '/Users/abc/Desktop/practice/test_adding_extension/ios/Runner/Runner-Bridging-Header.h'

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

@haphu4247
Copy link
Author

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
Copy link

khalidrinaldy commented Feb 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants