receive_sharing_intent icon indicating copy to clipboard operation
receive_sharing_intent copied to clipboard

`fatal error: 'Flutter/Flutter.h' file not found` since Xcode 26 update

Open atn832 opened this issue 3 months ago • 13 comments

Ever since some Xcode update 2 days ago, my Share Extension won't compile anymore. Here's the log:

Swift Compiler Error (Xcode): Clang dependency scanner failure: While building module 'receive_sharing_intent' imported from receive_sharing_intent-cc13ccc6.input:1:
In file included from <module-includes>:1:
In file included from
~/Library/Developer/Xcode/DerivedData/Runner-akwfooptcthmhsenhzurarpfousn/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/receive_
sharing_intent/receive_sharing_intent.framework/Headers/receive_sharing_intent-umbrella.h:13:
~/Library/Developer/Xcode/DerivedData/Runner-akwfooptcthmhsenhzurarpfousn/Build/Intermediates.noindex/ArchiveIntermediates/Runner/BuildProductsPath/Release-iphoneos/receive_
sharing_intent/receive_sharing_intent.framework/Headers/ReceiveSharingIntentPlugin.h:1:9: fatal error: 'Flutter/Flutter.h' file not found
receive_sharing_intent-cc13ccc6.input:1:1: fatal error: could not build module 'receive_sharing_intent'

I've tried everything I could find on the internet, removing Podfile.lock, running pod install again, changing this and that setting in Xcode... Trying to build it on another Mac, going back in my git history... I went as far as deleting the whole ios folder and recreating both the main project and the Share Extension. Same issue.

Has anyone else encountered the same issue?

atn832 avatar Sep 18 '25 05:09 atn832

Ok so I ended up trying different forks of that project on pub.dev, since they say that this one has been abandoned. Most of the forks that have not diverged much produce the same error. However, after migrating to https://pub.dev/packages/share_handler, my iOS app compiles again, and sharing works!

atn832 avatar Sep 18 '25 07:09 atn832

I encountered the same problem, but unfortunately I cannot replace this library. Is there any way to solve this issue?

zhponng avatar Sep 19 '25 07:09 zhponng

I found the solution:

  1. Open the Runner project with Xcode 26
  2. Follow the operations in the following screenshot to set Explicitly Built Modules to NO
Image

This can be compiled, but I'm not sure of the specific function of this option, or what other issues it might cause; everyone can provide feedback to a wider audience.

zhponng avatar Sep 19 '25 09:09 zhponng

I found the solution:

  1. Open the Runner project with Xcode 26
  2. Follow the operations in the following screenshot to set Explicitly Built Modules to NO
Image This can be compiled, but I'm not sure of the specific function of this option, or what other issues it might cause; everyone can provide feedback to a wider audience.

For me that works fine. I use the package for all types of sharing. URL, Images, File

nberghold avatar Sep 19 '25 13:09 nberghold

doesnt fix it for me

bhavukar avatar Sep 20 '25 20:09 bhavukar

I found the solution:

  1. Open the Runner project with Xcode 26
  2. Follow the operations in the following screenshot to set Explicitly Built Modules to NO
Image This can be compiled, but I'm not sure of the specific function of this option, or what other issues it might cause; everyone can provide feedback to a wider audience.

worked for me but we will switch to a more stable and not abandoned plugin.

fullflash avatar Sep 24 '25 11:09 fullflash

This saved me a loooot of time :)

daiki1003 avatar Sep 25 '25 06:09 daiki1003

I found the solution:

  1. Open the Runner project with Xcode 26
  2. Follow the operations in the following screenshot to set Explicitly Built Modules to NO
Image This can be compiled, but I'm not sure of the specific function of this option, or what other issues it might cause; everyone can provide feedback to a wider audience.

seemed to resolve the build issue locally but the app does not open when using the actual share extension. looks like the device wants to do something on app tap, but does not navigate to the app with the shared url. Could just be something else on my end, unsure

Update, seems to be working again. the CUSTOM_GROUP_ID build setting got cleared in xcode. Jk. only working on simulator. Not real device Jk, Jk. Only working on ios 18 simulator. Does not work w/ ios 26 simulator or real device.

itzJustKranker avatar Sep 25 '25 20:09 itzJustKranker

after this fix there is a new crash about layout constraint...if i bypass this app won't open

bozzaandreaab avatar Sep 26 '25 08:09 bozzaandreaab

I found the solution:

  1. Open the Runner project with Xcode 26
  2. Follow the operations in the following screenshot to set Explicitly Built Modules to NO
Image This can be compiled, but I'm not sure of the specific function of this option, or what other issues it might cause; everyone can provide feedback to a wider audience.

seemed to resolve the build issue locally but the app does not open when using the actual share extension. looks like the device wants to do something on app tap, but does not navigate to the app with the shared url. Could just be something else on my end, unsure

Update, seems to be working again. the CUSTOM_GROUP_ID build setting got cleared in xcode. Jk. only working on simulator. Not real device Jk, Jk. Only working on ios 18 simulator. Does not work w/ ios 26 simulator or real device.

Yep, the share extension stopped working altogether for my app since I made the change. Can't even open a share sheet from inside the app either.

Does anyone have any other solutions?

taufiq-husain avatar Sep 26 '25 14:09 taufiq-husain

Ok so I ended up trying different forks of that project on pub.dev, since they say that this one has been abandoned. Most of the forks that have not diverged much produce the same error. However, after migrating to https://pub.dev/packages/share_handler, my iOS app compiles again, and sharing works!

After trying this method, it's finally working. It required a bit of configuration fixes and code changes BUT alas, it works perfectly now and with a more up-to-date package. Thanks!

taufiq-husain avatar Sep 26 '25 20:09 taufiq-husain

@zhponng Thanks! This fixed my problem!

Himera19 avatar Oct 12 '25 17:10 Himera19

I found the solution:

  1. Open the Runner project with Xcode 26
  2. Follow the operations in the following screenshot to set Explicitly Built Modules to NO
Image This can be compiled, but I'm not sure of the specific function of this option, or what other issues it might cause; everyone can provide feedback to a wider audience.

thanks bro

osmancan23 avatar Oct 21 '25 10:10 osmancan23