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?

Developer technologies .NET Xamarin
Developer technologies Visual Studio Other
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.