Search Unity

Package not found error

Discussion in 'Package Manager' started by tjt748, Mar 21, 2020.

  1. tjt748

    tjt748

    Joined:
    Oct 4, 2019
    Posts:
    8
    I used the package manager to install "Alpaca.Markets" API package with no error messages.

    The script is simple:

    using Alpaca.Markets;
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class Trade02 : MonoBehaviour
    {
    private static AlpacaTradingClient client;
    // Start is called before the first frame update
    void Start()
    {

    }
    // Update is called once per frame
    void Update()
    {

    }
    }

    When I run Unity I get the error message:

    error CS0246: The type or name 'Alpaca' could not be found

    (The Alpaca.Markets API package works in c# program. I am trying to create interface with Unity)

    Any suggestions would be helpful. Thanks
     
  2. IsopodInAnEscapePod_unity

    IsopodInAnEscapePod_unity

    Unity Technologies

    Joined:
    Sep 20, 2019
    Posts:
    18
    Can you post the version of Unity you were running and attach any editor logs you have?

    It would also help if you could include your project's manifest.json.
     
  3. tjt748

    tjt748

    Joined:
    Oct 4, 2019
    Posts:
    8
    Thanks for replying.

    I am using Unity 2018.4.10f1

    I am new to using Unity - where do I find the manifest.json

    Where do I find the editor log. Since I am trying to use the Alpaca API, I only created a GameObject (cube) and attached the script to it. In Visual Studio I installed the Alpaca.Markets package using the package manager.
     
  4. IsopodInAnEscapePod_unity

    IsopodInAnEscapePod_unity

    Unity Technologies

    Joined:
    Sep 20, 2019
    Posts:
    18
    You can find your project's manifest.json in [Your project folder]/Packages - replace [Your project folder] with the path to your project.

    This page will let you know where you can find the log files: https://docs.unity3d.com/Manual/LogFiles.html
     
  5. tjt748

    tjt748

    Joined:
    Oct 4, 2019
    Posts:
    8
    Attached are the manifest.json and editor.log files.
     

    Attached Files:

  6. IsopodInAnEscapePod_unity

    IsopodInAnEscapePod_unity

    Unity Technologies

    Joined:
    Sep 20, 2019
    Posts:
    18
    It seems as though the Alpaca.Markets API package may not have installed for your project at all, I can't see it in the manifest.json; as far as I know, packages installed for your project should have a corresponding listing in the manifest.

    Does the Alpaca.Markets package show up in the 'In Project' tab of Package Manager for you?

    I'm also curious as to where you installed the package from. Did you install it from disk through Package Manager?
     
  7. tjt748

    tjt748

    Joined:
    Oct 4, 2019
    Posts:
    8
    If I go to the project manager and select the installed tab I get the following:

    upload_2020-3-25_10-51-51.png

    so it looks like it is installed.

    I didn't install it from a disk.
    I clicked on:

    Project --> Manage NuGet Packages.. --> Browse --> (Entered) Alpaca.Markets

    not sure where it looks for the NuGet packages

    I didn't see an 'In Project' tab.
     
  8. IsopodInAnEscapePod_unity

    IsopodInAnEscapePod_unity

    Unity Technologies

    Joined:
    Sep 20, 2019
    Posts:
    18
    ksy64320 likes this.
  9. tjt748

    tjt748

    Joined:
    Oct 4, 2019
    Posts:
    8
    Thanks for the link. I will try to figure it out.
     
  10. tjt748

    tjt748

    Joined:
    Oct 4, 2019
    Posts:
    8
    I made the changes described in the link. I don't get any error messages for the script in Visual Studio.
    I am getting the following error messages in Unity:

    Assembly 'Library/ScriptAssemblies/Assembly-CSharp.dll' will not be loaded due to errors:
    Reference has errors 'Alpaca.Markets'.

    Assembly 'Assets/Plugins/Alpaca.Markets.dll' will not be loaded due to errors:
    Unable to resolve reference 'Newtonsoft.Json'. Is the assembly missing or incompatible with the current platform?
    Reference validation can be disabled in the Plugin Inspector.
    Unable to resolve reference 'Microsoft.Extensions.Configuration.Abstractions'. Is the assembly missing or incompatible with the current platform?
    Reference validation can be disabled in the Plugin Inspector.
    Unable to resolve reference 'WebSocket4Net'. Is the assembly missing or incompatible with the current platform?
    Reference validation can be disabled in the Plugin Inspector.
    Unable to resolve reference 'SuperSocket.ClientEngine'. Is the assembly missing or incompatible with the current platform?
    Reference validation can be disabled in the Plugin Inspector.


    Can you tell me how to fix this.

    Thanks
     
  11. IsopodInAnEscapePod_unity

    IsopodInAnEscapePod_unity

    Unity Technologies

    Joined:
    Sep 20, 2019
    Posts:
    18
    It looks you need to repeat what you did for the Alpaca.Markets package for the NuGet packages it depends on as well.

    NuGet package manager will tell you which packages those are in the 'Dependencies' section for Alpaca.Markets. Try repeating the process for each of those packages and see if it works.
     
  12. tjt748

    tjt748

    Joined:
    Oct 4, 2019
    Posts:
    8
    Thanks. I will do that.