KasemJaffer / receive_sharing_intent

A Flutter plugin that enables flutter apps to receive sharing photos, text and url from other apps.
Apache License 2.0
325 stars 372 forks source link

iOS, flutter.h File not found after following Readme instructions #220

Closed mobikats closed 2 years ago

mobikats commented 2 years ago

Build fails after following all of the Readme instructions for iOS, with:

Screenshot 2022-05-12 at 10 15 39

Looking on this SO post, the "solution" is to delete the ios project folder and recreate it - however, doing that, then adding back in this extension, simply leads back to this position.

Any guidance on how to resolve this and still keep the share extension would be very welcome, thanks in advance.

mobikats commented 2 years ago

Xcode 13.3.1 flutter --version Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision 5464c5bac7 (3 weeks ago) • 2022-04-18 09:55:37 -0700 Engine • revision 57d3bac3dd Tools • Dart 2.16.2 • DevTools 2.9.2

mobikats commented 2 years ago

This was a problem caused by having additional targets created with flutter_flavorizr, I reverted back to the default target and it's ok. I've not actually fixed the flavor targets yet, but I believe they can be.

anhtuan23 commented 1 year ago

@mobikats Hi, have you managed to make this works with flutter_flavorizr yet? I'm having the exactly same problem too. Thanks.

anhtuan23 commented 1 year ago

Related issues: https://github.com/AngeloAvv/flutter_flavorizr/issues/134 and https://github.com/flutter/flutter/issues/103977

I built successfully following this advice

I can build my app after clearing "Objective-C Bridging Header" from Build Settings of target extension.

anhtuan23 commented 1 year ago

Just for reference, I also have to do this to make this works on all flavors:

For each Target (main app Runner and ShareExtension), go to Build Settings > Packaging > Product Bundle Identifier and set the appropriate bundle identifier based on flavor.

mobikats commented 1 year ago

Hi @anhtuan23, sorry for my slow response here, it sounds like you have figured it out though and done the right things. I wish I had written better notes at the time! But from memory I think I resolved it by manually editing each target settings.

anhtuan23 commented 1 year ago

Thanks for your reply, I did manage to resolve this problem. Though I ended up using a similar package called share_handler.