Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAUI - IOS - Apple Store - Build rejected - Sentry contains bitcode #2022

Closed
legrignotin opened this issue Oct 27, 2022 · 16 comments
Closed
Assignees
Labels
Bug Something isn't working Framework: MAUI

Comments

@legrignotin
Copy link

legrignotin commented Oct 27, 2022

Package

Sentry.Maui

.NET Version

6.0.402

SDK Version

3.22.0-preview.3

Steps to Reproduce

  1. Include Sentry in your MAUI project
  2. Build project as Release and sign it (in Azure DevOps pipeline)
    - task: DotNetCoreCLI@2 displayName: 'Build and Sign IOS App' inputs: command: 'publish' publishWebProjects: false projects: '**/Mobile.csproj' arguments: '-f net6.0-ios -c $(BuildConfiguration) /p:ArchiveOnBuild=true /p:CodesignKey="$(AppleCodesignKey)" /p:CodesignProvision="$(AppleCodesignProvision)" -o $(build.artifactstagingdirectory)/ios/' zipAfterPublish: false modifyOutputPath: false
  3. Use Azure DevOps release to publish it to the AppStore (TestFlight)
    Microsoft Job used

Expected Result

The build appears in test flight without any error.

Actual Result

The pipeline show the following warning:

Waiting for the build to show up in the build list - this may take a few minutes (check your email for processing issues if this continues)

I got an e-mail with the following error:

ITMS-90482: Invalid Executable - The executable 'Mobile.app/Frameworks/Sentry.framework/Sentry' contains bitcode.

image

@legrignotin legrignotin added Bug Something isn't working Platform: .NET labels Oct 27, 2022
@legrignotin legrignotin changed the title IOS - Apple Store - Build rejected - Sentry contains bitcode MAUI - IOS - Apple Store - Build rejected - Sentry contains bitcode Oct 27, 2022
@bruno-garcia bruno-garcia moved this to Needs Discussion in Mobile & Cross Platform SDK Oct 27, 2022
@mattjohnsonpint
Copy link
Contributor

Hi! Thanks for reporting this. I'll investigate asap.

@mattjohnsonpint mattjohnsonpint moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Oct 27, 2022
@mattjohnsonpint
Copy link
Contributor

mattjohnsonpint commented Oct 27, 2022

@legrignotin - Could I ask you please to try again with the latest 3.23.0-preview.3 just published? (It has Sentry.Cocoa 7.28.0). I think you will get the same thing, but I'm not certain. Thanks.

@mattjohnsonpint
Copy link
Contributor

@philipphofmann @brustolin - I think this is related to getsentry/sentry-cocoa#2304, getsentry/sentry-cocoa#2307, and getsentry/sentry-cocoa#2332

The build of Sentry.Maui reported was using Sentry.Cocoa 7.24.1 - but it's a custom build due to the Catalyst issue
in getsentry/sentry-cocoa#2031. I don't know if I had XCode 14 yet or not when I built it.

The error appears to be saying that bitcode isn't allowed at all now, so I'm confused by 7.29.0 enabling it. Am I missing something?

I also want to see what happens with the newer version. I updated to 7.28.0, and I'm pretty sure I had XCode 14 for that one.

@mattjohnsonpint mattjohnsonpint self-assigned this Oct 27, 2022
@legrignotin
Copy link
Author

@mattjohnsonpint
I tried with the brand new 3.23.0-preview.3 and it works perfectly, I didn't have to change anything (code or pipelines), the publishing was straight forward and the errors shows up in sentry web UI as expected!
Thanks again for the quick answer and the help :)

Repository owner moved this from Needs Investigation to Done in Mobile & Cross Platform SDK Oct 28, 2022
@mattjohnsonpint
Copy link
Contributor

Thanks for letting us know. I'm glad it's working now!

@philipphofmann - I'm still concerned that the next version might break it again, given bitcode was just turned on in 7.29.0. Thoughts?

Repository owner moved this from Done to Needs Discussion in Mobile & Cross Platform SDK Oct 30, 2022
@mattjohnsonpint
Copy link
Contributor

Keeping this open for now, due to another report of this
https://twitter.com/GolfJimB/status/1586683123143561217

@mattjohnsonpint mattjohnsonpint moved this from Needs Discussion to Needs Investigation in Mobile & Cross Platform SDK Oct 30, 2022
@GolfJimB
Copy link

Yea I'm having the same issue with 3.23 preview-3

@mattjohnsonpint
Copy link
Contributor

mattjohnsonpint commented Oct 31, 2022

@legrignotin @GolfJimB - Can you please each tell me which version of XCode you are using on the mac you are building and submitting to the App Store with?

The situation appears that XCode 13 and prior required bitcode enabled for libraries and frameworks, when the application itself had bitcode enabled. (per getsentry/sentry-cocoa#2304)

But with XCode 14, bitcode is deprecated and is required to be disabled, and is by default. At least, that's my interpretation of the following in the XCode 14 release notes:

Deprecations
Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.

Xcode no longer builds bitcode by default and generates a warning message if a project explicitly enables bitcode: “Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode.” The capability to build with bitcode will be removed in a future Xcode release. IPAs that contain bitcode will have the bitcode stripped before being submitted to the App Store. Debug symbols can only be downloaded from App Store Connect / TestFlight for existing bitcode submissions and are no longer available for submissions made with Xcode 14. (86118779)

  • Sentry for .NET 3.22.0 included version 7.24.1 of Sentry's Cocoa framework, which was likely built on XCode 13 with bitcode enabled by default.

  • Sentry for .NET 3.23.0 includes version 7.28.0 of Sentry's Cocoa framework, which was built on XCode 14 with bitcode disabled by default. Thus this version should be working.

  • We haven't updated the .NET side yet, but the 7.29.0 version of Sentry's Cocoa framework turns bitcode back on - so I think this would cause the error again. @philipphofmann @brustolin - We probably need to revert that.

I'm still not sure why using 3.23.0 (7.28.0) worked for @legrignotin but not for @GolfJimB.

@GolfJimB
Copy link

Xcode 14.0.1 (21336) with iOS16 targeted and .net 7.0.

FYI my web app that uses Sentry.AspNetCore is in the same solution and I had to remove that too for apple to accept my latest build. (That was also version 3.23.0)

@mattjohnsonpint
Copy link
Contributor

Thanks for the details. We'll keep investigating.

Yes, that second part would makes sense, assuming you have a common library that you are using both in your main app and your web app and Sentry is used in that library.

The full dependency tree (for iOS) is:

  • Sentry Cocoa SDK
    • Sentry.Bindings.Cocoa
      • Sentry
        • Sentry.Extensions.Logging
          • Sentry.Maui
          • Sentry.AspNetCore

The issue in question is in the Sentry Cocoa SDK.

@GolfJimB
Copy link

Crisis averted, I had an old version of Sentry referenced in another library. I updated that and now it works. Thanks guys, love the product!

@mattjohnsonpint
Copy link
Contributor

@GolfJimB - Just to confirm, 3.23.0 did indeed work all the way through publishing to the app store?

@GolfJimB
Copy link

Yep, all good

@brustolin
Copy link
Contributor

Hey @mattjohnsonpint we were receiving complains about our Carthage project not having bitcode enabled. Until Xcode 13, bitcode was enabled by default and all SDK versions had it enabled.

Xcode 14 disabled it, we had to manually turn it on to not introduce a breaking change. Unity project did not compile with Bitcode disabled, and old projects started to showing an annoying warning.

I didn't know Apple was rejecting new projects with Bitcode enabled. So it looks like to solution is to disabled it and tell users to also disabled it.

@brustolin
Copy link
Contributor

cc @bitsandfoxes
This will eventually impact you.

@mattjohnsonpint
Copy link
Contributor

@brustolin - Thanks. That aligns with what I was seeing as well.

Since our 3.23.0 includes a version with bitcode disabled, and @legrignotin and @GolfJimB has confirmed that is working, then I'll close this issue. We'll be sure to wait to update the Cocoa SDK again until bitcode is re-disabled there.

Thanks everyone!

Repository owner moved this from Needs Investigation to Done in Mobile & Cross Platform SDK Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Framework: MAUI
Projects
Archived in project
Development

No branches or pull requests

4 participants