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

Bitcode is deprecated when publishing app to appstore MAUI in 7.0.200-preview.22628.1 #12863

Closed
KSemenenko opened this issue Jan 23, 2023 · 45 comments
Labels
area-core-platform Integration with platforms platform/iOS 🍎 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Milestone

Comments

@KSemenenko
Copy link
Contributor

KSemenenko commented Jan 23, 2023

Description

I installed the latest version of VS code for Mac (7.0.200-preview.22628.1 with MAUI workload) and found out that this issue is still there.
#10989

Steps to Reproduce

Use a framework containing bitcode

Link to public reproduction project repository

no

Version with bug

Unknown/Other (please specify)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

IOS

Did you find any workaround?

 <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>

This code helped me. the solution works.
Maybe it should be added by default?

Relevant log output

No response

@KSemenenko KSemenenko added the t/bug Something isn't working label Jan 23, 2023
@PureWeen
Copy link
Member

@SotoiGhost thoughts?

@SotoiGhost
Copy link
Contributor

Hi @KSemenenko! 👋🏼 Thank you for your time in reporting this issue.

I think this is a question for the iOS team. The workaround seems harmless, but not sure if this could cause any harm later as this is directly modifying the framework saved on the disk.

@dalexsoto, @rolfbjarne, thoughts on this?

P.S: Regardless of whether this is added, it is best to report the affected framework to its owner so they can fix this from the root.

@KSemenenko
Copy link
Contributor Author

I'm currently doing native binding for agora, they have xcframework.
This is their official sdk, and it seems to work for swift or objective c.

I have this issue when I send the binary to TestFlight.

Also, the experience with bindings in general is not very smooth. It turned out that sln with the bindings library can't be next to maui project. It should be a separate project.

I'm still working on it, but if you need any feedback, I'll be happy to help =)

@SotoiGhost
Copy link
Contributor

@KSemenenko you can verify if a framework has bitcode or has the bitcode marker flag enabled by running the following command:

# Replace the path
otool -l path/to/your/Foo.xcframework/ios-arm64/Foo.framework/Foo | grep __LLVM -1

The command should not throw anything if there's no bitcode, otherwise will throw you something like this:

  cmdsize 152
  segname __LLVM
   vmaddr 0x000000000006c000
--
  sectname __bundle
   segname __LLVM
      addr 0x000000000006c000

Hope this helps you!

@KSemenenko
Copy link
Contributor Author

Thanks for your advice, I think now that my sdk is swift.
https://learn.microsoft.com/en-us/xamarin/ios/platform/binding-swift/walkthrough

Will try this one

@KSemenenko
Copy link
Contributor Author

one more questions, https://swiftpackageindex.com/AgoraIO/AgoraRtcEngine_iOS
so this is swift, but if it xcframework I have to anyway create one more swift librarty or I can just use sdk, because thay have h files

@rolfbjarne
Copy link
Member

Also, the experience with bindings in general is not very smooth. It turned out that sln with the bindings library can't be next to maui project. It should be a separate project.

Yes, we know it's not very smooth, we have known issues we're working on in this area.

I think this is a question for the iOS team. The workaround seems harmless, but not sure if this could cause any harm later as this is directly modifying the framework saved on the disk.

Yes, the workaround seems harmless, but I'm hesitant to add code on our side for this, because:

  • The app developer can work around it themselves.
  • The real fix is for the vendor to fix their SDK to not contain bitcode (since Apple completely deprecated bitcode, at the very least it's useless to ship it).
  • It may seem harmless, but there's always a risk.

@KSemenenko
Copy link
Contributor Author

@rolfbjarne thanks for answers!

Well, in fact, for me it is the documentation that is the most difficult. I do not understand the clear steps to be taken. I'm C# developer and have no idea aboout swift and xcode.

So far I have realized that I have to make another library which will be a wrapper for the sdk (and this makes a lot of sense)
But on the other side of the SDK is the same exact library .framework
And according to the documentation, I then have to add to the iOS project a link to the original sdk and a link to my new library-binding-wrapper. But then why do I need an wrapper?

But I'm optimistic and determined to do it =)

@Eilon Eilon added the area-core-platform Integration with platforms label Jan 26, 2023
@jfversluis jfversluis added this to the Backlog milestone Jan 27, 2023
@ghost
Copy link

ghost commented Jan 27, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@Syed-RI
Copy link

Syed-RI commented Apr 13, 2023

I think this should be a build task enabled via a flag

@vplife1
Copy link

vplife1 commented Oct 19, 2023

@SotoiGhost I have tried above code lines but show the following error

The command "/Users/apple/Downloads/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip /Users/apple/.nuget/packages/harfbuzzsharp.nativeassets.ios/2.8.2.3/runtimes/ios/native/libHarfBuzzSharp.framework/libHarfBuzzSharp -r -o /Users/apple/.nuget/packages/harfbuzzsharp.nativeassets.ios/2.8.2.3/runtimes/ios/native/libHarfBuzzSharp.framework/libHarfBuzzSharp" exited with code 127. (MSB3073)

Please provide me a appropriate solution

@vplife1
Copy link

vplife1 commented Oct 19, 2023

I have used the above code snippet but it shows an error follows how to resolve it
I have tried above code lines but show the following error

The command "/Users/apple/Downloads/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip /Users/apple/.nuget/packages/harfbuzzsharp.nativeassets.ios/2.8.2.3/runtimes/ios/native/libHarfBuzzSharp.framework/libHarfBuzzSharp -r -o /Users/apple/.nuget/packages/harfbuzzsharp.nativeassets.ios/2.8.2.3/runtimes/ios/native/libHarfBuzzSharp.framework/libHarfBuzzSharp" exited with code 127. (MSB3073)

Please provide me a appropriate solution

@rolfbjarne
Copy link
Member

@vplife1 please attach a binlog (https://aka.ms/binlog) that shows the error.

@vplife1
Copy link

vplife1 commented Oct 20, 2023

@rolfbjarne and @Eilon and @SotoiGhost I am facing issue when try to add my app on app store it throws the following iisues
We identified one or more issues with a recent delivery for your app, "Calmanac App" 1.0 (3). Please correct the following issues, then upload again.

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

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

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

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

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

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

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

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

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

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

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

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

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

Please suggest me a correct way how to resolve this issue , I am not able to add my app on app store test flight

@maonaoda
Copy link
Contributor

whats wrong, i cant build ios device any more.

1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.8968-net8-rc2\targets\Xamarin.Shared.Sdk.targets(744,3): warning MT7091: 框架 C:/Users/xyz/.nuget/packages/xamarin.firebase.ios.core/8.10.0.3/lib/net6.0-ios15.4/Firebase.Core.resources/GoogleUtilitiesComponents.xcframework/ios-arm64/GoogleUtilitiesComponents.framework 是静态库的框架,不会复制到应用。
1>"$(xcrun -find bitcode_strip)"  -r -o
1>C:\Users\xyz\.nuget\packages\xamarin.firebase.ios.core\8.10.0.3\buildTransitive\Xamarin.Firebase.iOS.Core.targets(216,5): error : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip: missing argument(s) to: -o option
1>Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip input [-r | -m | -l] [-keep_cs] -o output
1>C:\Users\xyz\.nuget\packages\xamarin.firebase.ios.core\8.10.0.3\buildTransitive\Xamarin.Firebase.iOS.Core.targets(216,5): error MSB3073: 命令“"$(xcrun -find bitcode_strip)"  -r -o ”exit,code is 1。

@vplife1
Copy link

vplife1 commented Oct 23, 2023

@rolfbjarne please check binlogs
binlogs.zip

Still, I am facing the same issue reply to me ASAP. It's very needful

@vplife1
Copy link

vplife1 commented Oct 23, 2023

@maonaoda Are you facing the same issue
We identified one or more issues with a recent delivery for your app, "Calmanac App" 1.0 (3). Please correct the following issues, then upload again.

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

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

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

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

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

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

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

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

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

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

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

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

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

@rolfbjarne
Copy link
Member

@rolfbjarne please check binlogs binlogs.zip

Still, I am facing the same issue reply to me ASAP. It's very needful

This is the error:

    /var/folders/9n/mtg32cps619cr17mb5klfpvh0000gn/T/MSBuildTempapple/tmpa2b0cbfaa61e4c39900e52fc04d85cf3.exec.cmd: line 2: /Users/apple/Downloads/Xcode: No such file or directory

It looks like there's something that doesn't like the space in the path to your Xcode, so /Users/apple/Downloads/Xcode 2.app becomes /Users/apple/Downloads/Xcode, and that's not quite right obviously.

The binlog doesn't show me where the space-broken logic is, but there should be a fairly easy workaround: extract your Xcode again from the xip file, and use a path that doesn't contain spaces (don't rename your existing Xcode, because we've had issues in the past where renaming Xcode causes really weird errors later on - instead it's better to extract it again from the xip file).

@rolfbjarne
Copy link
Member

@maonaoda

whats wrong, i cant build ios device any more.

1>C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.8968-net8-rc2\targets\Xamarin.Shared.Sdk.targets(744,3): warning MT7091: 框架 C:/Users/xyz/.nuget/packages/xamarin.firebase.ios.core/8.10.0.3/lib/net6.0-ios15.4/Firebase.Core.resources/GoogleUtilitiesComponents.xcframework/ios-arm64/GoogleUtilitiesComponents.framework 是静态库的框架,不会复制到应用。
1>"$(xcrun -find bitcode_strip)"  -r -o
1>C:\Users\xyz\.nuget\packages\xamarin.firebase.ios.core\8.10.0.3\buildTransitive\Xamarin.Firebase.iOS.Core.targets(216,5): error : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip: missing argument(s) to: -o option
1>Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip input [-r | -m | -l] [-keep_cs] -o output
1>C:\Users\xyz\.nuget\packages\xamarin.firebase.ios.core\8.10.0.3\buildTransitive\Xamarin.Firebase.iOS.Core.targets(216,5): error MSB3073: 命令“"$(xcrun -find bitcode_strip)"  -r -o ”exit,code is 1。

Please get a binary build log (binlog) that shows the error - this explains how to get the binlog: https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#binary-build-logs

@vplife1
Copy link

vplife1 commented Oct 23, 2023

@rolfbjarne @rolfbjarne I've tried, but I am still facing the same issue. When I remove the Firebase NuGet reference from my project, it works, and I can submit my app to the App Store. I need a solution for removing Bitcode from the Firebase NuGet. Can you please assist me with that?

@SotoiGhost
Copy link
Contributor

SotoiGhost commented Oct 23, 2023

@rolfbjarne do you think the xcrun -find bitcode_strip command is missing some extra quotes due to possible whitespaces?

<Exec Command="xcrun -find bitcode_strip" ConsoleToMSBuild="true">

@rolfbjarne
Copy link
Member

@SotoiGhost

@rolfbjarne do you think the xcrun -find bitcode_strip command is missing some extra quotes due to possible whitespaces?

<Exec Command="xcrun -find bitcode_strip" ConsoleToMSBuild="true">

Not sure

@vplife1 can you get a binlog that shows the error? That would make it much easier to figure out what's going on on your machine.

@vplife1
Copy link

vplife1 commented Oct 23, 2023

@rolfbjarne @rolfbjarne
I am using the code block from this link:
#10989 (comment) but it's still not working. Am I missing something? Please suggest. Also, when I use this code block, I encounter another issue like below.

/Users/apple/Downloads/Vivek/Projects/CalmanacMobileAPP/CalmanacMobileAPP/CalmanacMobileAPP/CalmanacMobileAPP.csproj(3,3): Error MSB3073: The command "/Users/apple/Downloads/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip -r -o /Users/apple/.nuget/packages/harfbuzzsharp.nativeassets.ios/2.8.2.3/runtimes/ios/native/libHarfBuzzSharp.framework/libHarfBuzzSharp /Users/apple/.nuget/packages/harfbuzzsharp.nativeassets.ios/2.8.2.3/runtimes/ios/native/libHarfBuzzSharp.framework/libHarfBuzzSharp" exited with code 127. (MSB3073) (CalmanacMobileAPP)

@vplife1
Copy link

vplife1 commented Oct 23, 2023

@SotoiGhost

@rolfbjarne do you think the xcrun -find bitcode_strip command is missing some extra quotes due to possible whitespaces?

<Exec Command="xcrun -find bitcode_strip" ConsoleToMSBuild="true">

Not sure

@vplife1 can you get a binlog that shows the error? That would make it much easier to figure out what's going on on your machine.

Yes, @rolfbjarne this is the issue shown in binlog

/Users/apple/Downloads/Vivek/Projects/CalmanacMobileAPP/CalmanacMobileAPP/CalmanacMobileAPP/CalmanacMobileAPP.csproj(377,5): error MSB3073: The command "/Users/apple/Downloads/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip /Users/apple/.nuget/packages/harfbuzzsharp.nativeassets.ios/2.8.2.3/runtimes/ios/native/libHarfBuzzSharp.framework/libHarfBuzzSharp -r -o /Users/apple/.nuget/packages/harfbuzzsharp.nativeassets.ios/2.8.2.3/runtimes/ios/native/libHarfBuzzSharp.framework/libHarfBuzzSharp" exited with code 127.
249 Warning(s)
1 Error(s)

@maonaoda
Copy link
Contributor

maonaoda commented Oct 24, 2023

@rolfbjarne
Copy link
Member

@maonaoda

@rolfbjarne CentralNode_devenv_PID=2120_x64_BuildManager_Default.zip

I think this might be an issue with MAX_PATH, where some of the frameworks can't be extracted/created on Windows with the default path locations.

Can you try creating a small root directory (say C:\x), and then setting the XamarinBuildDownloadDir property to that value in your csproj:

<PropertyGroup>
    <XamarinBuildDownloadDir>C:\</XamarinBuildDownloadDir>
</PropertyGroup>

If that doesn't work, please get an updated binlog.

@maonaoda
Copy link
Contributor

maonaoda commented Oct 24, 2023

@rolfbjarne
thanks for diagnosing.
but it was not working.
by the way , i had enabled long file support.
and it could deploy into iOS device last week.
But now as long as Xamarin.Firebase.iOS.Core is used, it cannot be deployed。

@rolfbjarne
Copy link
Member

@maonaoda does the following directory exist on your Windows machine?

C:/MSBuildReproLogs/GAppM-8.9.1/GoogleAppMeasurement-8.9.1/Frameworks

@maonaoda
Copy link
Contributor

@rolfbjarne
Yes,
image

@rolfbjarne
Copy link
Member

I wonder if you're running into this problem: xamarin/xamarin-macios#19229

Can you try the workaround mentioned here to see if that fixes it: xamarin/xamarin-macios#19229 (comment)?

@maonaoda
Copy link
Contributor

@rolfbjarne
workaround of xamarin/xamarin-macios#19229 (comment) fixes my problem #12863 (comment)
about xcrun -find bitcode_strip
thanks you for your work.

@rolfbjarne
Copy link
Member

Thanks for confirming!

@maonaoda
Copy link
Contributor

@rolfbjarne
I think this happened when i upgraded VS 2022 version 17.8.0 from Preview 3.0 to Preview 4.0 last week

@vplife1
Copy link

vplife1 commented Oct 25, 2023

@rolfbjarne
Copy link
Member

@vplife1 you're still using a path to an Xcode with a space in the path: /Users/apple/Downloads/Xcode 2.app.

Can you try and see if this works? I've added quotes to try to support spaces in the Xcode location:

  <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="&quot;$(_BitcodeStripCommand)&quot; %(_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>

@vplife1
Copy link

vplife1 commented Oct 26, 2023

@rolfbjarne Yes it works thank you!

@jfversluis
Copy link
Member

Is there still anything to be done here or can this one be closed?

@jfversluis jfversluis added the s/needs-info Issue needs more info from the author label Nov 22, 2023
@ghost
Copy link

ghost commented Nov 22, 2023

Hi @KSemenenko. 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.

@ghost ghost added the s/no-recent-activity Issue has had no recent activity label Nov 27, 2023
@ghost
Copy link

ghost commented Nov 27, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@Kbmobi
Copy link

Kbmobi commented Nov 28, 2023

I personally am still running into this issue, and no work arounds provided have been a solution for me. I used to be able to run the simulator and build to a device, but that all stopped once I added in code to interact with firebase for cloud messaging.

I am running on .Net8, and targeting Xcode 15 with Visual Studio on PC linked to my mac.

I would like to note that I can still get GitHub Actions to make a release build via MacOs13 runner with Xcode 15.0.1, but I need to be able to debug as well without having to strip out all my push notification/cloud messaging code.

@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 s/no-recent-activity Issue has had no recent activity labels Nov 28, 2023
@homeyf homeyf added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Nov 29, 2023
@ghost
Copy link

ghost commented Nov 29, 2023

Hi @KSemenenko. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

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.

@homeyf
Copy link
Collaborator

homeyf commented Nov 29, 2023

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 1.0. Not repro on iOS platform.

@ghost ghost closed this as completed Dec 6, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2024
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-core-platform Integration with platforms platform/iOS 🍎 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests