I have tried to install both the In App Purchases services package, and the Analytics services package. Each one has given me the compilation error regarding ‘AotHelper’.
Library/PackageCache/com.unity.services.core@1.10.1/Runtime/Telemetry/Handlers/MetricsHandler.cs(21,13): error CS0103: The name 'AotHelper' does not exist in the current context
I have reimported all my packages, updated my version of Unity to 2022.3.5f1, not sure what else to do. If I understand AotHelper is included with the built in NewtonSoft package, so I can’t really touch or modify that.
What do I need to do to use these services packages?
AotHelper is specific to the “Newtonsoft.Json-for-Unity” fork of Json.Net and not part of the upstream general Json.Net. You likely have multiple copies of “Newtonsoft.Json.dll” in your project, Unity’s own version and an upstream Json.Net version, and only one of them can be used. Which one gets used is undefined and essentially random, you should get a warning in the Console, though.
You’ll have to find the duplicate upstream versions and remove them, ideally you should only have the DLLs from the “com.unity.nuget.newtonsoft-json” package in your project. Search your Assets, Packages and Library/PackageCache folders for “Newtonsoft.Json.dll” to see which packages/plugins have it bundled, then either update the dependency or modify it to not include the DLL – you might have to add a reference to Unity’s package instead.
It means you have multiple copies of Json.Net in your project. One you already had somewhere before installing Unity Services, and another one that Unity Services just installed as a dependency. You need to keep the package version that Unity Services installed because they have made some modifications to it. So go find the other copy and remove it, and the compilation error will be gone.