Onesignal-ios-sdk: error: using bridging headers with framework targets is unsupported

Created on 19 May 2016  路  12Comments  路  Source: OneSignal/OneSignal-iOS-SDK

Hi
I try to use OneSignal under a Swift Framework and I can not 馃槶
Can you change your pod that we can use your SDK as a true Swift module where we don't need to use a bridge file. 馃槩
Or better you can change your SDK to be compatible with Carthage 馃槈

Most helpful comment

Couple modifications:
1- There's now a module.modulemap file in the OneSignal.framework that gets imported either manually or from CocoaPods / Carthage. Make sure not to use any branch besides the master (no "swift" etc.
2- Drop the iOS 10 beta branch as iOS 10 beta support was added to the B version of the main Framework.

Yay! :)

All 12 comments

May be you should take a look at this article: Wrapping a C Library in a Swift Framework

If you define a module map we can see your framework as a swift Module and use a code like this:

import OneSignal

Thanks for the suggestions, we haven't added Carthage support yet as we need to still support iOS 7. We will be looking to how to support both before moving forward.

If I check on iOS Version stats iOS 7 is just 5.6% of the device!
I'm 99% sure they will never move to iOS 8 or above until theirs devices break. 馃構

@TofPlay 5% is high enough where many of our developers will want to continue to support these users. Once it is around 1% to 2% we can consider dropping support.

This repo is used in our Unity, Corona (Ionic, Intel XDK, PGB), Cordova, react native, Xamarin, and Marmalade SDKs as well so we need to consider compatibility with these platforms as well.

My plan is to use the same code but have 2 different Xcode projects pointing to the same code. However I still have to research the best options to do this.

My plan is to use the same code but have 2 different Xcode projects pointing to the same code. However I still have to research the best options to do this.

Just create one projet with 2 Targets. The first set to iOS 7 and the other to iOS 8 or above. Same sources but different setting.
May be this article will help too: Swift Cross Platform Framework 馃憤

@TofPlay Thanks for the suggestions, I'll try that out after I release 2.4.0 our Android SDK next week.

@TofPlay You can try out our Beta SDK with iOS 10 support which is written is Swift as has Carthage support.
https://documentation.onesignal.com/docs/ios-10-beta

It's on my todo list 馃槈
But I can not take care of it right away. I'm already full busy to maintain projects on Swift 2 and prepare the migration on Swift 3.
But I'm glad OneSignal supports Swift 3 and Carthage 馃憤 馃槏
It will help me a lot 馃構

Hi @jkasten2 I just tested your version and I have some errors. See ticket #62.
It's an issue with a latest version of Swift 3 with the latest Xcode 8 Beta. It's not an issue with Carthage. 馃檪

Couple modifications:
1- There's now a module.modulemap file in the OneSignal.framework that gets imported either manually or from CocoaPods / Carthage. Make sure not to use any branch besides the master (no "swift" etc.
2- Drop the iOS 10 beta branch as iOS 10 beta support was added to the B version of the main Framework.

Yay! :)

@JKalash I have an issue on Xcode 7.3.1 with Swift 2.2 project, OneSignal version 2.1.5 and Carthage (see ticket #73)

I have solved it in this way, Detailed steps are here, Solution to Xcode Error: using bridging headers with module interfaces is unsupported

Solution:

In your Project Level & Target level Build Settings tab, open the Build Options menu. And then set Build Libraries for Distribution option to No.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chmiiller picture chmiiller  路  6Comments

arthurdapaz picture arthurdapaz  路  5Comments

huahengling picture huahengling  路  5Comments

konkontos picture konkontos  路  3Comments

dirkoswanepoel picture dirkoswanepoel  路  5Comments