Search Unity

Integrating Google API: Assembly will not be loaded due to errors

Discussion in 'Editor & General Support' started by dyllandry, Mar 17, 2019.

  1. dyllandry

    dyllandry

    Joined:
    May 26, 2016
    Posts:
    2
    I'd be grateful for any help on this issue. I don't think it is complicated, I just have a poor understanding of .NET.

    I am trying to integrate a simple feedback system that submits data to a Google Sheet. I am have trouble specifically with adding Google's API dll file to Unity.

    I used NuGet for Unity to download Google's Api. Because the API is compatible with .NET 4.5, I followed Microsoft's Using .NET 4.x in Unity guide. Here is what I've done so far.
    1. Change Unity's Scripting Runtime Version to .NET 4.x Equivalent
    2. Change Unity's Api Compatibility Level to .NET 4.x
    3. Placed the Google.Apis.dll into Assets/Plugins.
    When I attempt to run the game I receive this error:
    Assembly 'Assets/Plugins/Google.Apis.dll' will not be loaded due to errors:
    Unable to resolve reference 'Google.Apis.Core'. Is the assembly missing or incompatible with the current platform?
    Unable to resolve reference 'Newtonsoft.Json'. Is the assembly missing or incompatible with the current platform?

    Again, I would be grateful for any help. If you need more information let me know.
     
  2. dyllandry

    dyllandry

    Joined:
    May 26, 2016
    Posts:
    2
    I believe I found a solution. I thought, maybe they are missing, and maybe I can get them.

    I found Netwonsoft.Json and Google.API.Core on NuGet. Downloading their packages, renaming them to zips, unzipping them, and copying their dll files in /lib/netstandard2.0/ to my Assets/Plugins folder resolved the errors. :)
     
  3. hazel77744

    hazel77744

    Joined:
    Mar 28, 2019
    Posts:
    1
    loaded Google.Apis, netwonsoft.json, google.api.core dll

    still facing issues with .NET 4.x with error : [Unloading broken assembly Assets/Plguins/GoogleAPIs/Google.Apis.Core.dll, this assembly can cause crashes in the runtime]

    appreciate any advices in advance!