Building an external class library not working when trying to include into project.

I’m trying to include the Google webfornts api into my project and reference it but I keep having problems, I’ve tried three different things:

  • Building out a class library of a Nuget package with another solution
  • Imported the the API directly into the solution using NuGet
  • Tried importing using the Unity Nuget pack asset

This is the class lib settings:
139040-unknown.png

This is the Unity solution finding the built lib:
139041-unknown-1.png

But nothing’s working, the current error I get with adding the class library to my project is Assembly 'Assets/GoogleFont/libs/GoogleFontAPI.dll' will not be loaded due to errors:Unable to resolve reference 'Google.Apis.Webfonts.v1'. Is the assembly missing or incompatible with the current platform?Unable to resolve reference 'Google.Apis'. Is the assembly missing or incompatible with the current platform?

Well, you haven’t mentioned:

  • what plarform you try to build for and which NET support you’re targetting within Unity
  • If you actually imported one of the “Google.Apis.Webfonts.v1.dll” versions from the Nuget package. Keep in mind that you should only have one version that is actually compatible with Unity inside the plugins folder of your project.

That’s essentially what the compiler already asked you:

Is the assembly missing or
incompatible with the current
platform?

As you can read on the project page you need at least .NET 4+ support. It is explicitly stated that is will not work on any .NET version below 4.0 or on UWP. Also .NET standard is only supported when you have .NET core available. So it highly depends on your choosen scripting and runtime backend in Unity.

Note that I haven’t used that library so i can not tell if it’s actually compatible with Unity or not. Maybe it has some more dependencies which you may not be able to resolve.