Xamarin.Forms Additional Arguments

Bryan Franklin 0 Reputation points
2023-07-31T13:34:21.84+00:00

Hello,

When building an application with Xamarin.Forms, I am running into an error with using the option of Additional Arguments for iOS with -gcc_flags "-fobjc-arc". When I use this argument I get the error of:

Error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -fobjc-arc -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker Documents/GitHub/Trunk/Source/iOS/obj/iPhoneSimulator/Debug/Entitlements.xcent (MT5201) (DOMA.iOS)

When I remove the Additional Argument for iOS, the application can build. Is the argument that I am using incorrect?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,260 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,419 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,960 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 30,741 Reputation points Microsoft Vendor
    2023-08-01T06:05:38.75+00:00

    Hello,

    The -fobjc-arc flag indicates automatic reference counting, which is a memory managing mechanism in the swift language.

    Please refer to Automatic Reference Counting for more details.

    In C#, since C# has its own memory managing mechanism Automatic Memory Management, you don't need to specify ARC.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments