Lee
Lee

Reputation: 149

Testing ClarifAI and seeing "The type or namespace name 'Clarifai' could not be found" in the Unity console

I performed the following steps to test ClarifAI image recognition in a new project and am having issues. These are the steps I took:

Visual Studio gives no issues with the code, however, in the Unity console I see: 

enter image description here  

Here is the code:

using UnityEngine;
using System;
using System.Collections.Generic;
using Clarifai.Api;
using Clarifai.Channels;
using Grpc.Core;
using StatusCode = Clarifai.Api.Status.StatusCode;
using UnityEngine.Profiling.Memory.Experimental;

public class AItest : MonoBehaviour
{
    void Start()
    {
        var client = new V2.V2Client(ClarifaiChannel.Grpc());

        var metadata = new Metadata
        {
            {"Authorization", "Key {YOUR_PERSONAL_TOKEN}"}
        };
    }
}

Usually, when I see that error, I also see underlines in the using statements but not this time. I also tried uninstalling and reinstalling ClarifaiGrpc but that didn't help.

I already have an API key and will replace YOUR_PERSONAL_TOKEN with it in the code when I can overcome these errors.

Any assistance to resolve this would be greatly appreciated, thank you.

Upvotes: 0

Views: 75

Answers (1)

Jeremy Faret
Jeremy Faret

Reputation: 326

I'm not sure nuget package are fully compatible with Unity? You may want to look at NuGet packages in Unity

Upvotes: 1

Related Questions