microsoft/appcenter-sdk-apple

"Ignoring duplicate library '-lc++'" compiler warning with XCode 15

stevekellyhpe opened this issue ยท 11 comments

Description

The warning "Ignoring duplicate library '-lc++'" is shown when building a project that has integrated the AppCenter SDK via Swift Package on Xcode 15. (Most recently reproduced with Xcode 15 beta 6 and AppCenter 5.0.3

Repro Steps

Please list the steps used to reproduce your issue.

  1. Create a new project in XCode
  2. Add the AppCenter SDK via Swift Package (I also included the AppCenter Crashes module)
  3. Import AppCenter somewhere in the project
  4. Build and note the duplicate library warning

Details

  1. Which SDK version are you using?
    • e.g. 5.0.3
  2. Which OS version did you experience the issue on?
    • e.g. iOS 15-17
  3. Which Xcode version did you build the app with?
    • e.g. Xcode 15 beta 6
  4. Which Cocoapods version are you using (run pod --version)?
    • e.g. NA
  5. What device version did you see this error on? Were you using an emulator or a physical device?
    • e.g. iPhone 14
  6. What language are you using?
    • Objective C
    • [ x ] Swift
  7. What third party libraries are you using?
    • None
  8. Please enable verbose logging for your app using MSAppCenter.setLogLevel(.verbose) before your call to MSAppCenter.start(...) for Swift, or [MSAppCenter setLogLevel:MSLogLevelVerbose] before [MSAppCenter start: ...] for Objective C and include the logs here:
  • NA (compiler warning)

Hello @stevekellyhpe, I was able to reproduce this warning on Xcode15 beta 6.
But according Xcode 15 Beta 6 Release Notes (Known issues) was found the following:

  • Use of one C++ class template with multiple specializations in Swift could lead to duplicate definition link errors. (107757051)

Also I found that these warnings also appears for other SDKs (for example - getsentry/sentry-cocoa#3122)

I think this is an XCode15 Beta 6 issue. Let's wait for further betas and check if issue still persists.

BTW, it appears the Sentry SDK that you linked to addressed the issue via change to their Package.swift file:

getsentry/sentry-cocoa#3188

issue seems still to be present in Xcode 15 Beta 7

This is still an issue in the Xcode 15 RC. We need AppCenter to update the Package.swift to no longer include

.linkedLibrary("z"),
.linkedLibrary("sqlite3"),

I tried to remove these packages from Package.swift, but unfortunately it did not solve the problem. You can try it using SDK version from fix-duplicate-library'-lc++' branch.

Can anyone test if it is still broken on Xcode 15.1 beta?

@DmitriyKirakosyan I can still reproduce it with the XCode 15.1 Beta, and appcenter-sdk-apple version 5.0.4. (This is with a brand new project that imports AppCenter and nothing else.)

Please fix this (it make it impossible to run unit tests in Xcode 15) :)

@cho-trackman, I've tried to reproduce it on Xcode 15.1 beta 2 - and found that the issue is gone. Please, try to use this version of Xcode and let us know if it helps.

I'm also no longer able to reproduce this on XCode 15.1 beta 2.

I'm going to close it as fixed in new version of Xcode. If it reoccurs, please inform me.