microsoft / appcenter-sdk-apple

Development repository for the App Center SDK for iOS, macOS and tvOS.
Other
565 stars 224 forks source link

Xcode 12.5b3: Umbrella header is missing necessary headers #2274

Closed sebastian-foreflight closed 3 years ago

sebastian-foreflight commented 3 years ago

Description

Compilation issues when including the SDK with Swift Package Manager and Xcode 12.5b3. The SDK is included in my application using

@import AppCenter;
@import AppCenterCrashes;
@import AppCenterDistribute;

Repro Steps

  1. Include AppCenter Crashes and/or Distribute using SPM and @import statements
  2. Try to build with Xcode 12.5b3

Details

  1. Which SDK version are you using?
    • 4.10 and latest master branch
  2. Which OS version did you experience the issue on?
    • N/A
  3. Which Cocoapods version are you using (run pod --version)?
    • N/A
  4. What device version did you see this error on? Were you using an emulator or a physical device?
    • Building for a simulator but I'd expect it to affect all devices
  5. What language are you using?
    • [x ] Objective C
    • [ x] Swift
  6. What third party libraries are you using?
  7. 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:

The compilation errors are:

Showing All Errors Only /Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterCrashes/AppCenterCrashes/include/AppCenterCrashes.h:21:1: Umbrella header for module 'AppCenterCrashes' does not include header '/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterCrashes/AppCenterCrashes/include/MSACService.h'

/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterCrashes/AppCenterCrashes/include/AppCenterCrashes.h:21:1: Umbrella header for module 'AppCenterCrashes' does not include header '/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterCrashes/AppCenterCrashes/include/MSACServiceAbstract.h'

/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterCrashes/AppCenterCrashes/include/AppCenterCrashes.h:21:1: Umbrella header for module 'AppCenterCrashes' does not include header '/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterCrashes/AppCenterCrashes/include/MSACAbstractLog.h'

/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterDistribute/AppCenterDistribute/include/AppCenterDistribute.h:15:1: Umbrella header for module 'AppCenterDistribute' does not include header '/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterDistribute/AppCenterDistribute/include/MSACService.h'

/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterDistribute/AppCenterDistribute/include/AppCenterDistribute.h:15:1: Umbrella header for module 'AppCenterDistribute' does not include header '/Users/sebastian/Library/Developer/Xcode/DerivedData/ForeFlightMobile-glmsfzqihztuoqadumlqhpzdfizk/SourcePackages/checkouts/appcenter-sdk-apple/AppCenterDistribute/AppCenterDistribute/include/MSACServiceAbstract.h'

I believe this is a new error in Xcode 12.5. I've resolved it for packages under my control by adding the headers to the umbrella header.

DmitriyKirakosyan commented 3 years ago

Hi @sebastian-foreflight

Thank you for getting in touch with us and reporting this issue!

We will investigate this problem with using the Xcode 12.5b3 and get back to you once we have an update.

Meanwhile, a small question. Have you had a chance to try this scenario on a stable Xcode version?

sebastian-foreflight commented 3 years ago

We will investigate this problem with using the Xcode 12.5b3 and get back to you once we have an update.

Thank you! Let me know if you have any further questions.

Meanwhile, a small question. Have you had a chance to try this scenario on a stable Xcode version?

Yes, everything builds just fine with Xcode 12.4. I believe this is a new check in Xcode 12.5.

DmitriyKirakosyan commented 3 years ago

Hi @sebastian-foreflight

I'm sorry for such a delay, just managed to install Xcode12.5b3 😅

Unfortunately I couldn't reproduce the issue following your steps. I installed AppCenter Crashes and Distribute modules using SPM, then included modules in AppDelegate just as you said and was able to successfully run the app on ios simulator (ios 14.5). Tested with both Swift and Objc.

Could you please try to reproduce the issue on an empty project? It would be helpful if you could share a sample as well.

sebastian-foreflight commented 3 years ago

Hi @DmitriyKirakosyan, I will work on a sample project for you.

One thing I should have clarified, this is actually a warning by default, but we, like many other teams have Treat Warnings as Errors set to Yes. The default is No so that might explain why it didn't reproduce when you tried.

sebastian-foreflight commented 3 years ago

UmbrellaHeader.zip

Here is a project with Treat Warnings as Errors set to Yes that fails to build with 12.5b3 and does build with 12.3

DmitriyKirakosyan commented 3 years ago

Hi @sebastian-foreflight

Thanks a lot for your demo project. You were right regarding the warnings. I was able to reproduce the issue once I turned this option ON. It is reproducing on your project as well.

Thanks a lot for reporting this issue. I filed a bug on our board and we will fix it according to our priority queue.

sebastian-foreflight commented 3 years ago

Hi @DmitriyKirakosyan

Thanks for letting me know and I'm glad to hear you were able to reproduce the issue. By way of prioritization input, this issue will block us, and likely a number of other teams, from moving to Xcode 12.5, which has a number of improvements we're excited about.

DmitriyKirakosyan commented 3 years ago

Hi @sebastian-foreflight

Sorry for the delay. We've merged the fix into develop. Could you try it out and tell me if it works for you?

sebastian-foreflight commented 3 years ago

We've merged the fix into develop. Could you try it out and tell me if it works for you?

Thanks for the fix. I did verify it successfully with the branch so I expect it'll continue to work, but I'll let you know if I see any further issues. From my standpoint this issue can be closed.

I've also noticed that the Xcode 12.5 RC doesn't have this same warning. I'm not sure if the Xcode team intends to re-introduce it later, but for anyone trying to reproduce the issue in the future, note that it's only known to occur in Xcode 12.5b3.

DmitriyKirakosyan commented 3 years ago

I was suspecting that it was a bug in Xcode beta. Anyways, better to be on the safe side :)

WERUreo commented 3 years ago

I have begun seeing this issue in my code today. I just so happened to update my Xcode from 12.4 to 12.5 this morning and this same set of build errors started happening. I updated my AppCenter SPM packages from v4.1.0 to v4.1.1 to no avail. Interestingly though, if I pull from the develop branch, the build succeeds.

DmitriyKirakosyan commented 3 years ago

@WERUreo, the fix is merged but it is not released yet.

AnastasiaKubova commented 3 years ago

The fix has been released in the 4.2.0 version of App Center SDK. Please update App Center to the latest version and let me know if this issue still persists.