braze-inc / braze-swift-sdk

Braze SDK for the Apple ecosystem, including: iOS, macOS, iPadOS, visionOS, tvOS
https://www.braze.com
Other
52 stars 19 forks source link

[Bug]: BrazeUICompat refuses to compile with some configurations #32

Closed alansteiman closed 1 year ago

alansteiman commented 1 year ago

Platform

iOS

Platform Version

iOS 15.2

Braze SDK Version

5.8.0

Xcode Version

13.4.1

Computer Processor

Intel

Repro Rate

100%

Steps To Reproduce

  1. Podfile looking like this:
    $brazeVersion = '5.8.0'
    def brazePod
    pod 'BrazeKitCompat', $brazeVersion
    pod 'BrazeUICompat', $brazeVersion
    end
  2. Compile

Expected Behavior

Compile correctly

Actual Incorrect Behavior

Getting the following errors while compiling:

Braze SDK:

Screen Shot 2023-01-05 at 1 18 57 PM

My project:

Screen Shot 2023-01-05 at 1 19 12 PM

Verbose Logs

No response

Additional Information

Already tried this: https://developer.apple.com/forums/thread/128535

hokstuff commented 1 year ago

Hi @alansteiman,

Are you following the Swift SDK migration guide steps? If you want to get your app up and running with the new SDK ASAP, you can follow Scenario 1 and be sure to update your imports as well as make changes around the specific dependency manager in your project. Also, are you using any relevant custom build flags in your project?

alansteiman commented 1 year ago

@hokstuff thanks for the quick response.

Yes I am following the scenario 1 of that migration guide. This is how I did:

1) Replace Appboy-iOS-SDK by BrazeKitCompat in the podfile and run pod install 2) Replace all the imports in both Swift and Objective-C 3) Compile error, the class ABKInAppMessageSlideupViewController was not found 4) Added BrazeUICompat in the podfile, same version as BrazeKitCompat (5.8.0) and run pod install 5) Compile error: Include of non-modular header inside framework module

Screen Shot 2023-01-06 at 11 30 07 AM
hokstuff commented 1 year ago

I see, it looks like you're running into linking issues during your Cocoapods migration.

This article suggests some workarounds for that error as well as possible root causes based on which headers are linked. I also have a few questions:

alansteiman commented 1 year ago

Hi @hokstuff, answering your questions:

I tried integrating the Braze pods in a new project and works fine, definitely it's something related to our massive Podfile. I will close this issue for now and continue investigating the root cause, whenever I find it will post it here for history purpose.

LucioPham commented 1 year ago

Hi @alansteiman @hokstuff

I'm also facing this issue. My project was also set up with a mix between Swift and ObjC.

I tried to build on the latest XCode 14 but still errors.

@alansteiman When you trying on a new project, did you try with a mix between Swift and ObjC?

I was also facing this issue, as seen in the image below.

Screenshot 2023-01-17 at 11 38 57
alansteiman commented 1 year ago

Hi @alansteiman @hokstuff

I'm also facing this issue. My project was also set up with a mix between Swift and ObjC.

I tried to build on the latest XCode 14 but still errors.

@alansteiman When you trying on a new project, did you try with a mix between Swift and ObjC?

I was also facing this issue, as seen in the image below.

Screenshot 2023-01-17 at 11 38 57

Hi @LucioPham, on a new project was only Swift

LucioPham commented 1 year ago

I see, it looks like you're running into linking issues during your Cocoapods migration.

This article suggests some workarounds for that error as well as possible root causes based on which headers are linked. I also have a few questions:

  • Is your host app written in Swift, ObjC, or a mix?
  • Are you doing any special integration, or are you using a vanilla Cocoapods integration?
  • Do you have any custom linker flags in your project?
  • Have you tried building on Xcode 14?

Hi @alansteiman, I believe this issue happened on a mixed project.

@hokstuff Could you help to take a look? I did try all workarounds from the article you mentioned but none of them work.

lowip commented 1 year ago

@alansteiman, @LucioPham

I'm re-opening this issue as we've been able to reproduce this exact error message with a different setup. We have identified a fix, and we'll update here once it's released.

LucioPham commented 1 year ago

Hi @lowip, thank you for your support, I also found other issues after integrating with the new Braze SDK. Should I create a new ticket issue for them?

lowip commented 1 year ago

Hi @LucioPham,

Please open new tickets for other issues.

Thanks

LucioPham commented 1 year ago

Hi @alansteiman, could you share your Podfile ?

alansteiman commented 1 year ago

Hi @alansteiman, could you share your Podfile ?

The podfile I have is highly attached to my company, will try to reproduce the issue at the smallest possible scale

LucioPham commented 1 year ago

Hi @alansteiman, @lowip , It really weird when I remove the line inhibit_all_warnings! in my Podfile the error just gone and I be able build successfully.

alansteiman commented 1 year ago

Hi @alansteiman, @lowip , It really weird when I remove the line inhibit_all_warnings! in my Podfile the error just gone and I be able build successfully.

I don't have that line at all

hokstuff commented 1 year ago

Hi @alansteiman @LucioPham,

We have released Swift SDK version 5.9.0 which addresses this issue. Please let us know if you run into further problems when using that version. Thanks!

alansteiman commented 1 year ago

Thanks @hokstuff, I tried the version 5.9.0 and was able to compile, archive and distribute via Testflight (using Xcode 14+), appreciate the effort 🙌