How can I stop Xamarin from building my app with bitcode enabled?

烂漫一生 提交于 2019-12-21 12:19:37

问题


In the configurations from my iOS build, there is no option to disable bitcode. While in Xcode it is possible to set ENABLE_BITCODE=NO

I need this because my linked frameworks are not build with bitcode, and nowadays Apple does not allow half-bitcode-compiled apps anymore.


回答1:


In your .csproj for your iOS application, search for the PropertyGroup for the release configuration that you need to turn off bit code for, i.e.:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">

Within that group, see if a MtouchEnableBitcode already exists and edit it, otherwise add:

<MtouchEnableBitcode>false</MtouchEnableBitcode>



回答2:


I am able to build the application with bitcode disabled by adding following lines to the iOS app project's .csproj file immediately before the closing </Project> tag.

<Target Name="BeforeCodesign">
  <Exec Command="$(_SdkDevPath)\Toolchains\XcodeDefault.xctoolchain\usr\bin\bitcode_strip %(_Frameworks.FullPath) -r -o %(_Frameworks.FullPath)" />
</Target>



回答3:


My team and I have done what Vittal Pai and SushiHangover suggested but we faced another error:

Command "\Applications\Xcode.app\Contents\Developer\Toolchains\XcodeDefault.xctoolchain\usr/bin\bitcode_strip PathToOurFrameWorks -r -o PathToOurFrameWorks" ended with code 3

^ It's translated from French so please don't bite me too hard :)

The only way we made it work was by importing the project from our GitHub to a Mac with VS 2017 and then rebuilding it there.

The error is still present on the Windows version but it's gone on the Mac version.



来源:https://stackoverflow.com/questions/37683978/how-can-i-stop-xamarin-from-building-my-app-with-bitcode-enabled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!