Debugging issue - Niantic.Google.Protobuf not found within Visual Studio 2022

Issue category: ARDK Virtual Studio Tools / Developer Tools
Host machine & OS version: Windows
Issue Environment : Visual Studio 2022
ARDK version: 2.3.0
Unity version: 2020.3.33f1

Description of the issue:
I have an issue with Visual Studio 2022 which is not building because of a missing reference to Niantic.Google.Protobuf - Because of this I am not able to debug within Unity.
Any help with this would be appreciated.

Hi Dave,

The editor we recommend for ARDK development is Visual Studio Code but if Visual Studio is necessary, I would suggest checking out this community forum post. The reply from Gilberto outlines a workaround for this.

Hey @Dave_Sowerby ,
If my workaround didn’t help, could you provide more info on the problem?
Specifically I’d like to see logs on the errors that you are getting, and maybe reproduction steps if there’s anything special about your situation.

Thanks for the replies, unfortunately I can’t follow the instructions fully as the folder structure for the ARDK is slightly different to what you refer to ( as below )

/Assets/ARDK/Plugins/Niantic.Protobufs/Google.Protobuf.3.19.4/net45/ does not exist the only folder I see in the ARDK/Plugins is “unity exports”

I have located the .dll / xml in:

…\Assets\ARDK\Plugins\unity_exports\ardk_client_platform\libs\protobuf_csharp_dll\Niantic.Protobufs\Niantic.Google.Protobuf.3.0.0

But - if I replace these files with the downloaded Google.Protobuf files I get a lot of errors within Unity e.g. ( a few examples )

Assets\ARDK\Telemetry_AnalyticsTelemetryPublisher.cs(13,67): error CS0311: The type ‘Niantic.ARDK.AR.Protobuf.ARDKTelemetryOmniProto’ cannot be used as type parameter ‘TApprovedEvents’ in the generic type or method ‘ARDKTelemetryService’. There is no implicit reference conversion from ‘Niantic.ARDK.AR.Protobuf.ARDKTelemetryOmniProto’ to ‘Google.Protobuf.IMessage<Niantic.ARDK.AR.Protobuf.ARDKTelemetryOmniProto>’.

Error: Could not load signature of Niantic.Platform.Analytics.Telemetry.ClientTelemetryMetricReflection:get_Descriptor due to: Could not load file or assembly ‘Niantic.Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. assembly:Niantic.Google.Protobuf, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null type: member:(null) signature:

Hey @Dave_Sowerby ,
I’m not really able to reproduce this error, so in order for me to reproduce, can you walk me through how you are trying to attach Visual Studio debugger to Unity?
And can you show me the full log you got before trying to replace the protobuf too?

Thanks for getting back to me, I can confirm having tried to attach VStudio to Unity again that it is now working. So although Visual Studio can not build the project it is still able to attach and set break points.
Thanks for the feedback on this issue.

oh, good to hear! Let me know if you have any other problems.

Hey @Gilberto ,

I’m having a similar issue, and I’m using 2.5.1. I would have expected this issue to be already resolved by now.

Here’s my error stack when trying to build with Visual Studio:

It’s a big issue for us since it looks like it’s also preventing us from debugging with Xcode after building the app. Xcode debugger keeps breaking while loading the app.