When I try to run app with Google.Ads.GoogleAds nuget package on MacOS with M1 silicon I get the following error :

Unhandled exception. System.IO.FileNotFoundException: Error loading native library. Not found in any of the possible locations: .../libgrpc_csharp_ext.arm64.dylib

Cannot really find where to obtain libgrpc_csharp_ext.arm64.dylib or where can I find source for it and how to compile.

Tag:google-ads-api, grpc, apple-m1, .net-6.0

9 comments.

  1. daniil_

    You can try to use prebuilt version of the native .dylib for Apple M1 CPUs:

    https://github.com/einari/Grpc.Core.M1

    https://www.nuget.org/packages/Contrib.Grpc.Core.M1/

    1. Hugh Perkins

      I just spent 2-3 hours trying to fix this problem. This solves it. Thank you. (I know typing meaningless comments is frowned upon, but, omg, awesome. I even tried using ChatGPT before this ,but that didnt help :P )

    2. Akash Pavate

      Can you please supply the detailed steps of adding the lib file to a project? I'm trying to build Azure Durable Functions and can't seem to get it to work.

    3. daniil_

      There is a well detailed description here github.com/einari/Grpc.Core.M1

    4. Christopher Penkin

      Interestingly enough installing the x64 version and not the Arm64 version solves this as well. No need for other packages.

    5. unlimitedfox

      @ChristopherPenkin can you explain how to do that?

  2. Ryan Haney

    You might have arrived here because you accidentally imported Grpc.Core instead of Grpc.Core.Api. If you are using grpc-dotnet (the now recommended package for grpc in dotnet applications), your code will compile when referencing the Grpc.Core package, but will fail trying to find libgrpc_csharp_ext.arm64.dylib. Switching from Grpc.Core to Grpc.Core.Api worked for me.

    1. Thomas Eyde

      Grpc.Core.Api is implicit referenced by Microsoft.Azure.Functions.Worker, no explicit reference to gRpc. Fails on Mac.

  3. featherbits

    Not sure what was causing this, but now, referencing Google.Ads.GoogleAds 15.0.0 in project that uses .net 7 (I did update to latest runtime and sdk), no longer causes this issue. Previously, as a hot fix, I was running same code on linux VM instead.

Add a new comment.