Missing Headers <OneSignal/OneSignal.h> (Cocoapods issue)
When using 1.0.2 of our Flutter SDK, some users that uses use_frameworks! in their podfiles (Swift projects) may see the following error:
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
In file included from /Users/bradhesse/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal-1.0.2/ios/Classes/OneSignalPlugin.m:28:
/Users/bradhesse/flutter/.pub-cache/hosted/pub.dartlang.org/onesignal-1.0.2/ios/Classes/OneSignalPlugin.h:29:9: fatal error: 'OneSignal/OneSignal.h' file not found
#import <OneSignal/OneSignal.h>
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
It appears to be an issue with how our Flutter SDK is unable to find headers for the native iOS SDK. I am working on this issue now.
Created an issue with Cocoapods here: https://github.com/CocoaPods/CocoaPods/issues/8090
When I run pod install from my terminal, I'm getting the following message...
[!] Unable to find a specification for
OneSignalDynamic (< 3.0, >= 2.8.8)depended upon byonesignal
@CharlesCleveJr Can you try running pod repo update?
@CharlesCleveJr Can you try running
pod repo update?
Thanks! This fixed the OneSignalDynamic (< 3.0, >= 2.8.8) for me.
I'm trying to use version 1.0.2 and I am not using Swift in my project. I do not see use_frameworks! in any of my project files. Getting a different header error about Flutter.h file not found when trying to run. Pod install completes just fine.
Is there a workaround for this? Reverting to version 1.0.0 and 1.0.1 did not help.
There was another strange problem I ran into while adding this plugin to my project after adding the OneSignal pod requirement as tracked here: https://github.com/flutter/flutter/issues/19338
I'm not sure if that issue might be related to this problem? The only way I was able to work around the above issue was by creating a /Users/Projects folder. Then I also ran into this issue: https://github.com/flutter/flutter/issues/20685
And used the workaround there to get to this missing header bug.
Also noting that I get the same problem when using the example app checked out from this repository. The only things I modified were the Bundle Identifiers to get the build to pass before blowing up on missing headers.
In file included from /Users/mose/Projects/OneSignal-Flutter-SDK/ios/Classes/OneSignalCategories.m:28:
/Users/user/Projects/OneSignal-Flutter-SDK/ios/Classes/OneSignalCategories.h:29:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
6 warnings and 1 error generated.
In file included from /Users/mose/Projects/OneSignal-Flutter-SDK/ios/Classes/OneSignalTagsController.m:28:
/Users/user/Projects/OneSignal-Flutter-SDK/ios/Classes/OneSignalTagsController.h:29:9: fatal error: 'Flutter/Flutter.h' file not found
#import <Flutter/Flutter.h>
^~~~~~~~~~~~~~~~~~~
@CharlesCleveJr Can you try running
pod repo update?Thanks! This fixed the
OneSignalDynamic (< 3.0, >= 2.8.8)for me.
I also ran into this issue and only found the fix in this unrelated issue. Can the documentation be updated to include the pod repo update step?
https://documentation.onesignal.com/docs/flutter-sdk-setup
Any update?
Everything builds correctly in flutter but in XCode I'm getting the following error on my OneSignalExtension target ld: library not found for -lBolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I got around the lBolts clang error I think and now I'm getting this... ld: '/Users/charlesclevelandjr/Library/Developer/Xcode/DerivedData/Runner-fmmlmvhpgfjgwcaiisqyaplyqjvu/Build/Products/Debug-iphoneos/Bolts/libBolts.a(BFAppLink.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/charlesclevelandjr/Library/Developer/Xcode/DerivedData/Runner-fmmlmvhpgfjgwcaiisqyaplyqjvu/Build/Products/Debug-iphoneos/Bolts/libBolts.a' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Never seen it before. Any ideas?
Any updates?
I got around the lBolts clang error I think and now I'm getting this...
ld: '/Users/charlesclevelandjr/Library/Developer/Xcode/DerivedData/Runner-fmmlmvhpgfjgwcaiisqyaplyqjvu/Build/Products/Debug-iphoneos/Bolts/libBolts.a(BFAppLink.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/charlesclevelandjr/Library/Developer/Xcode/DerivedData/Runner-fmmlmvhpgfjgwcaiisqyaplyqjvu/Build/Products/Debug-iphoneos/Bolts/libBolts.a' for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)Never seen it before. Any ideas?
Do you remove "use_frameworks!"?
No. I did disable bitcode on the Notification Service Target and it successfully built in XCode and Flutter. This wouldn't cause any errors when I archive and push to Apple would it?
@Nightsd01 any updates on this?
Try to comment "use_frameworks!"
Try to comment "use_frameworks!"
By then, Other plugins didn't work.
@Nightsd01 Any updates?
@Nightsd01 any update this is critical
I've done some more research recently and didn't make a lick of progress. For now, my only recommendation is to not use any Swift in your project and comment out use_frameworks! from your Podfile.
We will continue to investigate this since it doesn't seem like the issue in Cocoapods isn't making any headway
@Nightsd01 that is not an option firebase alone requires use_frameworks
@rlee1990 firebase does not requires it, I use firebase auth and database currently without any issues