Xamarin-macios: Nest framework problem

Created on 19 Feb 2019  路  3Comments  路  Source: xamarin/xamarin-macios

ios's umbrella framework which has a umbrella framework dependence could run on monitor but not on device, any solution? https://github.com/yinchengvy/Hyphenate.iOS.UI.git
@rolfbjarne

bug iOS

Most helpful comment

@juepiezhongren Thank you for your report!

As a workaround, use this in your yourapp.csproj, you will need to accommodate the path to your needs.

Add after:

<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />

the following:

<Target Name="BeforeCodesign">
    <Exec Command="\usr\bin\codesign -v --force --sign $(_CodeSigningKey) --timestamp=none $(ProjectDir)/$(AppBundleDir)/Frameworks/UmbrellaFramework.framework/Frameworks/SubFramework.framework/SubFramework" />
</Target>

If you have multiple nested frameworks, just duplicate the Exec step as many times as needed.

All 3 comments

Reference: https://xamarinhq.slack.com/archives/C99ER4A1M/p1550568216118800

dyld: Library not loaded: @rpath/MJRefresh.framework/MJRefresh
 Referenced from: /private/var/containers/Bundle/Application/163A7ACD-33D2-4CA7-8FC1-EB41A0700911/XamSample.iOS.app/Frameworks/EaseUI.framework/EaseUI
 Reason: no suitable image found.  Did find:
    /private/var/containers/Bundle/Application/163A7ACD-33D2-4CA7-8FC1-EB41A0700911/XamSample.iOS.app/Frameworks/EaseUI.framework/Frameworks/MJRefresh.framework/MJRefresh: code signature in (/private/var/containers/Bundle/Application/163A7ACD-33D2-4CA7-8FC1-EB41A0700911/XamSample.iOS.app/Frameworks/EaseUI.framework/Frameworks/MJRefresh.framework/MJRefresh) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

It seems we're not signing nested frameworks.

@juepiezhongren Thank you for your report!

As a workaround, use this in your yourapp.csproj, you will need to accommodate the path to your needs.

Add after:

<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />

the following:

<Target Name="BeforeCodesign">
    <Exec Command="\usr\bin\codesign -v --force --sign $(_CodeSigningKey) --timestamp=none $(ProjectDir)/$(AppBundleDir)/Frameworks/UmbrellaFramework.framework/Frameworks/SubFramework.framework/SubFramework" />
</Target>

If you have multiple nested frameworks, just duplicate the Exec step as many times as needed.

@dalexsoto
Thanks. And I add Condition=" '$(Platform)' == 'iPhone', because this problem only found on iphone device.

<Target Name="BeforeCodesign">
    <Exec Condition=" '$(Platform)' == 'iPhone' Command="\usr\bin\codesign -v --force --sign $(_CodeSigningKey) --timestamp=none $(ProjectDir)/$(AppBundleDir)/Frameworks/UmbrellaFramework.framework/Frameworks/SubFramework.framework/SubFramework" />
</Target>
Was this page helpful?
0 / 5 - 0 ratings