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

Serious issue with Dotnet MAUI iOS -- > Bitcode is deprecated when publishing app to appstore #10989

Closed
samirgcofficial opened this issue Oct 29, 2022 · 17 comments
Assignees
Labels
p/0 Work that we can't release without platform/iOS 🍎 t/bug Something isn't working

Comments

@samirgcofficial
Copy link
Contributor

Description

ITMS-90482: Invalid Executable - The executable '.app/Frameworks/FBLPromises.framework/FBLPromises' contains bitcode.
Thread : https://developer.apple.com/forums/thread/707443

Steps to Reproduce

This occurs when releasing dotnet maui project to stores. It passes on transporter then later we will get a mail from app store with this error : ITMS-90482: Invalid Executable - The executable 'NotesSolution.app/Frameworks/FBLPromises.framework/FBLPromises' contains bitcode.
I think maui has bitcode enabled even though it need not to be used.

Link to public reproduction project repository

https://developer.apple.com/forums/thread/707443

Version with bug

6.0.486 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 14

Did you find any workaround?

No response

Relevant log output

No response

@samirgcofficial samirgcofficial added the t/bug Something isn't working label Oct 29, 2022
@hartez
Copy link
Contributor

hartez commented Oct 31, 2022

@samirgcofficial What is FBLPromises?

@hartez hartez added the s/needs-info Issue needs more info from the author label Oct 31, 2022
@ghost
Copy link

ghost commented Oct 31, 2022

Hi @samirgcofficial. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@fenix2222
Copy link

Having the same issue. Any way to disable bitcode on release build?

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Nov 1, 2022
@samirgcofficial
Copy link
Contributor Author

FBLPromises

I have no idea what that is ! I know some how maui has bit code enabled on it's inner core which can't be disabled or removed.

@krunaldarji
Copy link

Same issue after build upload gets an email from apple

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

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

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

@c4l3b
Copy link

c4l3b commented Nov 1, 2022

Same issue here - just uploaded the first version of an app and it failed due to containing bitcode

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

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

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

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

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

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

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

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

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

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

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

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

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

@Redth Redth added the p/0 Work that we can't release without label Nov 1, 2022
@SotoiGhost
Copy link
Contributor

The listed frameworks above come from Google Apis for iOS Components repo.

These frameworks were built by us, using cocoapods and it seems that cocoapods enabled the bitcode by default.

We are going to disable the bitcode and release new versions of the affected frameworks ASAP.

@ganeshachary
Copy link

Facing issue when uploaded app to app store, got rejected with below reasons for MAUI App - IOS

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

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

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

Any workaround or solution for this?.

@MWierzchowiecki
Copy link

Temporary workaround xamarin/GoogleApisForiOSComponents#578 (comment)

@SotoiGhost
Copy link
Contributor

Building frameworks against Xcode 14 solves the issue of bitcode for open-source frameworks but some closed-source frameworks (e.g. Firebase Analytics) it requires an extra step to remove it from them. We are working to provide a workaround for those.

@jfversluis jfversluis removed the s/needs-attention Issue has more information and needs another look label Nov 4, 2022
@jfversluis jfversluis added this to the .NET 7 + Servicing milestone Nov 4, 2022
@polygonsheep
Copy link

This needs to be fixed for .NET 6 as well.

@SotoiGhost
Copy link
Contributor

SotoiGhost commented Nov 4, 2022

Folks! We had an inconvenience on the way, but finally we now have a workaround to fix the bitcode problem. Meanwhile the new Firebase packages with the fix are being cooked and released, you can use these MSBuild tasks to get rid of that pesky bitcode. Copy the following lines above the </Project> of your .csproj and build again:

  <PropertyGroup>
    <!-- Properties used to strip bitcode from frameworks when using Visual Studio for Mac -->
    <_StripBitcodeFromFrameworksMasterAfterTargets Condition="'$(OS)'=='Unix'">_ExpandNativeReferences</_StripBitcodeFromFrameworksMasterAfterTargets>
    <_StripBitcodeFromFrameworksMasterDependsOnTargets Condition="'$(OS)'=='Unix'">_StripBitcodeFromFrameworksOnMac</_StripBitcodeFromFrameworksMasterDependsOnTargets>

    <!-- Properties used to strip bitcode from frameworks when using Visual Studio for Windows -->
    <_StripBitcodeFromFrameworksMasterAfterTargets Condition="'$(OS)'!='Unix'">_ComputeFrameworkFilesToPublish</_StripBitcodeFromFrameworksMasterAfterTargets>
    <_StripBitcodeFromFrameworksMasterDependsOnTargets Condition="'$(OS)'!='Unix'">_StripBitcodeFromFrameworksOnWindows</_StripBitcodeFromFrameworksMasterDependsOnTargets>
  </PropertyGroup>
  
  <Target Name="_StripBitcodeFromFrameworksMasterTarget" 
          Condition="'$(_StripBitcodeFromFrameworksMasterDependsOnTargets)'!='' AND @(_FrameworkNativeReference->Count()) != 0" 
          AfterTargets="$(_StripBitcodeFromFrameworksMasterAfterTargets)" 
          DependsOnTargets="$(_StripBitcodeFromFrameworksMasterDependsOnTargets)" />

  <Target Name="_StripBitcodeFromFrameworksOnMac"
          Condition="('$(OutputType)'!='Library' OR '$(IsAppExtension)'=='True') AND '$(_SdkIsSimulator)'=='False'">
    
    <!-- Find the bitcode_strip command -->
    <Exec Command="xcrun -find bitcode_strip" ConsoleToMSBuild="true">
      <Output TaskParameter="ConsoleOutput" PropertyName="_BitcodeStripCommand" />
    </Exec>

    <!-- Strip the bitcode from frameworks -->
    <Exec Command="$(_BitcodeStripCommand) %(_FrameworkNativeReference.Identity) -r -o %(_FrameworkNativeReference.Identity)" />
  </Target>

  <Target Name="_StripBitcodeFromFrameworksOnWindows"
          Condition="('$(OutputType)'!='Library' OR '$(IsAppExtension)'=='True') AND '$(_SdkIsSimulator)'=='False' AND '$(IsMacEnabled)'=='true'">

    <!-- Strip the bitcode from frameworks -->
    <Exec SessionId="$(BuildSessionId)"
          Command="&quot;%24(xcrun -find bitcode_strip)&quot; %(_FrameworkNativeReference.Identity) -r -o %(_FrameworkNativeReference.Identity)" />

    <CopyFileFromBuildServer 
      SessionId="$(BuildSessionId)" 
      File="%(_FrameworkNativeReference.Identity)" 
      TargetFile="%(_FrameworkNativeReference.Identity)" />    
  </Target>

These tasks work from Mac and Windows and will get rid of the bitcode of all the [Xc]frameworks referenced within your project. These tasks will modify the original framework saved on your disk, so, after you run these, this is an action that cannot be undone, unless you download the framework again from its source (e.g. delete the .nuget/package/Foo folder and restore the Foo package again).

Hope this helps you!

@kimhag
Copy link

kimhag commented Nov 4, 2022

Folks! We had an inconvenience on the way, but finally we now have a workaround to fix the bitcode problem. Meanwhile the new Firebase packages with the fix are being cooked and released, you can use these MSBuild tasks to get rid of that pesky bitcode. Copy the following lines above the </Project> of your .csproj and build again:

  <PropertyGroup>
    <!-- Properties used to strip bitcode from frameworks when using Visual Studio for Mac -->
    <_StripBitcodeFromFrameworksMasterAfterTargets Condition="'$(OS)'=='Unix'">_ExpandNativeReferences</_StripBitcodeFromFrameworksMasterAfterTargets>
    <_StripBitcodeFromFrameworksMasterDependsOnTargets Condition="'$(OS)'=='Unix'">_StripBitcodeFromFrameworksOnMac</_StripBitcodeFromFrameworksMasterDependsOnTargets>

    <!-- Properties used to strip bitcode from frameworks when using Visual Studio for Windows -->
    <_StripBitcodeFromFrameworksMasterAfterTargets Condition="'$(OS)'!='Unix'">_ComputeFrameworkFilesToPublish</_StripBitcodeFromFrameworksMasterAfterTargets>
    <_StripBitcodeFromFrameworksMasterDependsOnTargets Condition="'$(OS)'!='Unix'">_StripBitcodeFromFrameworksOnWindows</_StripBitcodeFromFrameworksMasterDependsOnTargets>
  </PropertyGroup>
  
  <Target Name="_StripBitcodeFromFrameworksMasterTarget" 
          Condition="'$(_StripBitcodeFromFrameworksMasterDependsOnTargets)'!=''" 
          AfterTargets="$(_StripBitcodeFromFrameworksMasterAfterTargets)" 
          DependsOnTargets="$(_StripBitcodeFromFrameworksMasterDependsOnTargets)" />

  <Target Name="_StripBitcodeFromFrameworksOnMac"
          Condition="('$(OutputType)'!='Library' OR '$(IsAppExtension)'=='True') AND '$(_SdkIsSimulator)'=='False'">
    
    <!-- Find the bitcode_strip command -->
    <Exec Command="xcrun -find bitcode_strip" ConsoleToMSBuild="true">
      <Output TaskParameter="ConsoleOutput" PropertyName="_BitcodeStripCommand" />
    </Exec>

    <!-- Strip the bitcode from frameworks -->
    <Exec Command="$(_BitcodeStripCommand) %(_FrameworkNativeReference.Identity) -r -o %(_FrameworkNativeReference.Identity)" />
  </Target>

  <Target Name="_StripBitcodeFromFrameworksOnWindows"
          Condition="('$(OutputType)'!='Library' OR '$(IsAppExtension)'=='True') AND '$(_SdkIsSimulator)'=='False' AND '$(IsMacEnabled)'=='true'">

    <!-- Strip the bitcode from frameworks -->
    <Exec SessionId="$(BuildSessionId)"
          Command="&quot;%24(xcrun -find bitcode_strip)&quot; %(_FrameworkNativeReference.Identity) -r -o %(_FrameworkNativeReference.Identity)" />

    <CopyFileFromBuildServer 
      SessionId="$(BuildSessionId)" 
      File="%(_FrameworkNativeReference.Identity)" 
      TargetFile="%(_FrameworkNativeReference.Identity)" />    
  </Target>

These tasks work from Mac and Windows and will get rid of the bitcode of all the [Xc]frameworks referenced within your project. These tasks will modify the original framework saved on your disk, so, after you run these, this is an action that cannot be undone, unless you download the framework again from its source (e.g. delete the .nuget/package/Foo folder and restore the Foo package again).

Hope this helps you!

This workaround works perfect. Many thanks 👍

@samirgcofficial
Copy link
Contributor Author

Is this expected ?
Screen Shot 2022-11-05 at 11 39 18 PM

@SotoiGhost
Copy link
Contributor

@samirgcofficial Noup, that's my fault. I forgot to skip these executions when there's no framework to strip. 😅

Please, replace the master conditional with this line:

Condition="'$(_StripBitcodeFromFrameworksMasterDependsOnTargets)'!='' AND @(_FrameworkNativeReference->Count()) != 0"

I'll edit the code above.

@samirgcofficial
Copy link
Contributor Author

samirgcofficial commented Nov 5, 2022

Finally ! :) Thanks
Screen Shot 2022-11-06 at 12 38 32 AM

@SotoiGhost
Copy link
Contributor

Folks! New Firebase packages without bitcode are now live in NuGet. You can now update and delete the workaround above if you were using it.

If you find another framework with bitcode that does not belong to us, please, report it to its owner and use the workaround above to unblock yourself meanwhile its fixed.

Let us know if anything happens related to these new frameworks and Apple.

Happy coding!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p/0 Work that we can't release without platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests