Grpc client for Oculus works in play mode but build fails (Building Library\Bee\artifacts\Android\d8kzr\libil2cpp.so failed)

I’m creating a project for Oculus Quest 2 using Oculus Integration package. It had been working fine (I could create a build and run the app on the headset) until I added gRPC client files (Google transport). Now I can only run my app in play mode in Unity editor but not build the project.

When I try to build my application here’s the error I get:

Building Library\Bee\artifacts\Android\d8kzr\libil2cpp.so failed with output:
ld.lld: error: undefined symbol: grpcsharp_init
>>> referenced by Grpc.Core__1.cpp:14150 (D:/Mauris/vr360/VR360.part1/backups/version before deleting Android folder/VR360/Library/Bee/artifacts/Android/il2cppOutput/cpp\Grpc.Core__1.cpp:14150)
>>>               Library/Bee/artifacts/Android/d8kzr/u2fq5kwozrum.o:(DllImportsFromStaticLib_grpcsharp_init_m2426CCF4CA2929DD8B718C5DF15B10DD30B8030C)

ld.lld: error: undefined symbol: grpcsharp_shutdown
>>> referenced by Grpc.Core__1.cpp:14157 (D:/Mauris/vr360/VR360.part1/backups/version before deleting Android folder/VR360/Library/Bee/artifacts/Android/il2cppOutput/cpp\Grpc.Core__1.cpp:14157)
>>>               Library/Bee/artifacts/Android/d8kzr/u2fq5kwozrum.o:(DllImportsFromStaticLib_grpcsharp_shutdown_m2A2ABDB39E9B838F10F8867825B96D9DA4FEFBE9)

ld.lld: error: undefined symbol: grpcsharp_version_string
>>> referenced by Grpc.Core__1.cpp:14164 (D:/Mauris/vr360/VR360.part1/backups/version before deleting Android folder/VR360/Library/Bee/artifacts/Android/il2cppOutput/cpp\Grpc.Core__1.cpp:14164)
>>>               Library/Bee/artifacts/Android/d8kzr/u2fq5kwozrum.o:(DllImportsFromStaticLib_grpcsharp_version_string_m0101E32FA4E0F986E07C9D7356DCD1465B17043E)

and it continues in a similar way with other undefined symbols.

I have tried creating an empty project with the same version of Unity and adding the same gRPC client files. Client works fine and I’m able to build the project.

Does anyone know how to fix the issue and make the application build again? Or any recommendation where to look?
Considering that gRPC client works in a separate project, do you know if there’s a way to isolate my gRPC plugins and files that use them from the rest of the project?

I would deeply appreciate any help!

Additional Information:

  1. I have tried deleting Library and Temp folders and reloading the project, it didn’t help.
  2. When I change Scripting backend from IL2CPP to Mono (ARM64 → ARMv7), the application starts to build again, but a lot of the Oculus features stop working.
1 Like