inbrainai / unitysdk

Monetize your app with the inBrain SDK using Unity.
MIT License
3 stars 1 forks source link

Using bridging headers with framework targets is unsupported #2

Closed jsvitek closed 1 year ago

jsvitek commented 1 year ago

Hello, we are using inbrain SDK in our Unity game. However when building iOS version of the game xcode always throws an error Using bridging headers with framework targets is unsupported. This does not return a non zero exit code, the ipa file is built and surveys work, however it is messing with our automated deployment via fastlane. Because of this error job always fails and so does the deployment.

Unity version: 2020.3.38.f1 InBrain version: v.1.5.0

susslik commented 1 year ago

Hello @jsvitek - thanks for reporting this! We will take a look at the trouble and fix that asap! Will keep you posted!

tustanivsky commented 1 year ago

@jsvitek do you use any other plugins in your project that might modify the PBXProject settings? I wasn't able to reproduce the error mentioned above with the demo app from this repo (Unity 2020.3.38.f1, Xcode 14.2) so maybe inBrain SDK conflicts with some other third-party solution that you're currently relying on?

jsvitek commented 1 year ago

Hello @tustanivsky, thanks a lot for helping me resolve this issue.

We are using Firebase, IronSource & AppsFlyer.

I was able to reproduce this issue by including only IronSource 2.7.2 (as well as ExternalDependencyManager 1.2.172) and InBrain 1.5.0. Using only IronSource + ExternalDependencyManager builds the ipa without any issues. After importing InBrain 1.5.0 (without PlayServicesResolver as that one has conflict with ExternalDependencyManager that we use in our project) the ipa will build but error I mentioned above will show up.

susslik commented 1 year ago

Hi @jsvitek - sorry for the delay. We're checking the additional details you shared, will back to you soon!

susslik commented 1 year ago

Hi @jsvitek - hope you're doing well! The main thing - is our iOS SDK is written in pure swift and doesn't have Bridging Headers at all. However, despite that, we went ahead and did a test of both InBrain 1.5.0 and InBrain 2.0.0 with Unity 2020.3.38.f1 using the new project and the sample app. The single difference - is we were trying the latest version of IronSource instead of 2.7.2 (which is a super old version). In each case creating the .ipa in Xcode (Product -> Archive) was completed without any errors.

Based on that - the error might be caused by something specific in your build pipeline (Xcode version, environment or Unity project settings, etc.).

jsvitek commented 1 year ago

Hi @susslik. I have to apologize I made a stupid typo in the IronSource version. The IronSource version we are using is actually 7.2.7. Really sorry about that. Also, thanks a lot for taking the time and helping me resolve this issue.

I updated the IronSource to the latest version 7.3.0.1 as you suggested and I am receiving the same bridging headers error as mentioned before. This time I'm including screenshot with IronSource version and version of all the adapters we are using.

InBrain SDK includes InBrainPostProcessor.cs which defines SWIFT_OBJC_BRIDGING_HEADER as found here. Removing this line results in ipa file built with no errors but I am sure this will cause unexpected behavior. Although in our case the game runs fine and InBrain seems to work but I was not able to able to test the actual surveys as the inbrain reports no surveys available in my region.

I also created an empty project (Unity 2020.3.38.f1) with ExternalDependencyManager 1.2.172, IronSource 7.3.0.1 and InBrain 2.0.0 where I am able to reproduce this issue every time I try to build iOS ipa. ipa file will be built but I get the bridging headers error. You can find the repository here. I Hope it helps.

image

susslik commented 1 year ago

Hi @jsvitek - thank you for the super detailed information and for helping us with the investigation! We will dig into the trouble next week and I believe we will find the solution - will keep you posted!

tustanivsky commented 1 year ago

Hey @jsvitek, please give it another shot with the latest plugin version v.2.0.1. We've removed that bridging header file from the project, so it shouldn't cause you any build errors.

jsvitek commented 1 year ago

Hi @tustanivsky, version 2.0.1 no longer throws the error and everything works as expected. Thanks a lot for taking the time and resolving this issue!

susslik commented 1 year ago

Hi @jsvitek - thank you for your patience and help with this!