ios-branch-deep-linking-attribution
ios-branch-deep-linking-attribution copied to clipboard
Build errors when integrating Branch using SPM in Xcode 12.5b3 when Warnings are treated as Errors
Hi
When building in Xcode 12.5b3 we get the following build errors because of missing .h files in Branch.h
Showing Recent Messages
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCTuneUtility.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCKeyChain.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCTelephony.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BranchCPIDRequest.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCAppleReceipt.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BranchContentPathProperties.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BranchCreditHistoryRequest.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCSKAdNetwork.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCJSONUtility.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCAppleAdClient.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCAppGroupsData.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCFieldDefines.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCSpotlightService.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BranchRedeemRewardsRequest.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BNCCallbackMap.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BranchShortUrlSyncRequest.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BranchOpenRequest.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BranchShortUrlRequest.h'
/Users/gransell/Library/Developer/Xcode/DerivedData/QapitalApp-dmxntnlexxpmpzglcjqigbzxmirt/SourcePackages/checkouts/ios-branch-deep-linking-attribution/Branch-SDK/Branch.h:1906:1: Umbrella header for module 'Branch' does not include header 'BranchLogoutRequest.h'
@gransell Were you able to get past this issue? I wasn't able to reproduce the issue.
@echo-branch Thanks for looking into this. I just gave this another look with a clean test project importing only Branch and was not able to reproduce there. Could be something with our project. I'll keep investigating. I'll close this for now and report any findings here when we manage to fix it.
@echo-branch
I revisited this now and turns out we got the errors because we had "Treat warnings as errors" turned on. We still get the warnings in a simple Xcode project that imports branch via SPM and just does a simple import Branch
in a swift file.
Attaching a sample project with the issue. BranchTest.zip
Ah yea, we have some clean up warnings tickets floating around for a while. We just haven't had the dev resources free up to fix them though.
I'm getting this error too. A temporary fix was to also turn off "Treat warnings as errors".
Yeah. That's the "fix" we have opted for as well.
Hey Branch, is there any update on this? As you know, XCode 12.5 is officially out, and this is a blocker to upgrading to XCode 12.5 for many of us.
It's in progress, however we've found some of the warnings are non-trivial to remove and may take some time to refactor away.
Hi @echo-branch! Any updates on this?
@nikolouzos The warnings should be fixed and merged into master, and will be in the next general release 1.40.0. We're still working on some testing of server signature changes on that version, so you should not try it yet.
Any update on this? I'd love to get back to warnings-as-errors but can't because of this issue.
@jsorge It's on track for the 1.40.0 release, however it did not make the 1.39.4 patch release.
@echo-branch When will 1.40.0 land?
I am still seeing this issue when using 1.40.2
Hi, this issue is present on 1.40.1
too.
Hi everyone, we are working on this and hope to get this out by the end of this month. We will update you all when the release is available.
Hi, also ran into this on 1.42, would be very nice to resolve this
It's quite annoying this issue, would be great if we can prioritise this and have it fixed in the new releases as it's been floating around for well over a year now
@TheCoordinator We hear you. Unfortunately the fix is to rename our library, which has cascading impact on all our build, test and documentation. It will get done, but it wasn't a simple one sprint fix we originally thought and will need to be on a major version update.
@echo-branch totally understandable. It would be good to understand, from your perspective, why certain fixes are not viable
- Adding the missing headers to Branch.h (understand we don't want files that aren't used but this could be a short term solution)
- Updating the modulemap file to exclude these headers explicitly (I don't see a modulemap for
Branch-SDK
) (example)
@jhurray
So the error message is a bit confusing. The actual issue is that the Branch.h
header is both the umbrella header and the header for a class. This leads to Xcode getting confused and throwing a lot of warnings. The fix is to create a dedicated umbrella header BranchSDK.h
and use Branch.h
as a class header. Internally we've already done this, but the impact outside the SDK is extensive.
For historical note, we ended up here by doing a quick fix hack to convert our static library SDK to a framework. That hack was to treat the Branch.h
as both a class header and umbrella header.
Got it - I see how thats an issue & how it can leak downstream into documentation etc.. Thanks & good luck
Side note - any idea why we would see this only in Xcode 14 and not Xcode 13.4? I'm sure its an apple thing but found that curious
@echo-branch FYI I found a decent workaround if you want to share this w/ folks:
- Create a local swift package that wraps
Branch
(IMO always a good practice for 3rd party SDKs) - in the
target
definition add a compiler flag to suppress warnings
Main downside is your local package will not have warnings, up to the consumer if that tradeoff is worth it
swiftSettings: [
.unsafeFlags(["-suppress-warnings"])
]
Edit: This is not working when I clean, will follow up if / when I make progress
@jhurray I like that strategy. It would be much nicer than globally disabling the warning.
Any progress here?
@pm-dev We have a branch that's currently undergoing testing. Since it's somewhat disruptive we've had to hold it for other feature work a couple times already. Currently we're planning on shipping it after we ship an update for SKAN 4.0.