Forum Xamarin.Forms

Framework is not a valid framework

adam_madam_m Member ✭✭
edited March 30 in Xamarin.Forms

Hi everyone, I am trying to add ironsource framework to my xamarin.ios project.
I have added dll and framework as per the documentation(https://developers.ironsrc.com/ironsource-mobile/xamarin/get-started-ironsource-xamarin-plugin-ios/). While building the project it says

'Native References/IronSource.framework/IronSource' is not a valid framework. Stock.iOS

I have searched how to add framework to ios project and I have added --mono:framework to my additional mtouch argument (according to Microsoft docs https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/native-references )

This is the output

3> /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/alim/Library/Caches/Xamarin/mtbs/builds/Stock.iOS/35ae000f376de9e87dbe72b91cd5610c/obj/iPhoneSimulator/Debug/response-file.rsp --mono:framework "--gcc_flags=-Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/alim/Library/Caches/Xamarin/mtbs/builds/Stock.iOS/35ae000f376de9e87dbe72b91cd5610c/obj/iPhoneSimulator/Debug/Entitlements.xcent"
3>D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(845,3): warning : warning: ignoring file Native References/IronSource.framework/IronSource, building for iOS Simulator-i386 but attempting to link with file built for unknown-unsupported file format ( 0x56 0x65 0x72 0x73 0x69 0x6F 0x6E 0x73 0x2F 0x43 0x75 0x72 0x72 0x65 0x6E 0x74 )
3>D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(845,3): warning : warning: ignoring file Native References/IronSource.framework/IronSource, building for iOS Simulator-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x56 0x65 0x72 0x73 0x69 0x6F 0x6E 0x73 0x2F 0x43 0x75 0x72 0x72 0x65 0x6E 0x74 )
3>D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(845,3): error MT0140: File 'Native References/IronSource.framework/IronSource' is not a valid framework.

Best Answer

  • adam_madam_m ✭✭
    Accepted Answer

    I was able to figure out the issue of why it was saying Invalid framework because of the IronSource file in the root folder it had bunch of text in it instead of fat binary. The fat binary was in A folder. So I copied and pasted to the root folder of the framework.

Answers

  • adam_madam_m Member ✭✭

    The framework has the following folders:

    IronSource.framework 
        ->Versions
            ->A
                ->Headers
                    ->C/C++ header files with .h extension
                ->IronSource
            ->Current
        ->Headers
        ->IronSource
        ->module.modulemap
    
  • adam_madam_m Member ✭✭
    Accepted Answer

    I was able to figure out the issue of why it was saying Invalid framework because of the IronSource file in the root folder it had bunch of text in it instead of fat binary. The fat binary was in A folder. So I copied and pasted to the root folder of the framework.

Sign In or Register to comment.