TwitchLib / TwitchLib.Unity

TwitchLib repository representing all code belonging to the implementation of TwitchLib for Unity. Maintained primarily by LuckyNoS7evin.
164 stars 33 forks source link

Assembly 'Assets/Plugins/TwitchLib.Unity.dll' will not be loaded due to errors #57

Closed SneakyAzWhat closed 3 years ago

SneakyAzWhat commented 3 years ago

I am using 2019.4.16f1 (LTS version) and started an empty project. I downloaded the latest .dll and put it into a plugins folder then received this error. The error also persisted even when I downloaded the sln and built my own dll. I was under the impression that I only needed to add the 'TwitchLib.Unity.dll'. Maybe I missed a step, any help is much appreciated :)

Assembly 'Assets/Plugins/TwitchLib.Unity.dll' will not be loaded due to errors: Unable to resolve reference 'TwitchLib.Api'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Unable to resolve reference 'TwitchLib.Client'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Unable to resolve reference 'TwitchLib.Communication'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Unable to resolve reference 'TwitchLib.PubSub'. 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.Logging.Abstractions'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Unable to resolve reference 'TwitchLib.Api.Core.Interfaces'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector. Unable to resolve reference 'TwitchLib.Client.Enums'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector.

twitchlib unity error

I did go in and disable 'reference validations' in the plugin inspector to see what would happen. I got a new error message from that.

Unloading broken assembly Assets/Plugins/TwitchLib.Unity.dll, this assembly can cause crashes in the runtime twitchlib unity error2

RedPapaSmurf commented 3 years ago

Experienced the same issue with the same build and Unity Ver. Switching to the previous release build and unity 2018 worked as a temporary fix.

SneakyAzWhat commented 3 years ago

@RedPapaSmurf I tried in 2020.2 just in case.. but same problem. I'll probably wait a bit and see if the library can be updated to at least work with 2019LTS. Lucky advised he would try to take some time to look at it this week if possible. So hopefully it is an easy fix, if not I will take up your suggestion!

Deroido commented 3 years ago

I'll probably wait a bit and see if the library can be updated to at least work with 2019LTS.

we're waiting for more than a year already...

swiftyspiffy commented 3 years ago

I can try to take a look in a few days (like the 4th), but I know absolutely nothing about Unity, so I don't know how helpful I'd be :(

Mom0aut commented 3 years ago

Hey i got the same problem, but i could fix it. (using Unity 2020)

I used this TwitchLib.Unity.dll from: https://github.com/TwitchLib/TwitchLib.Unity/releases/tag/1.0.0

And i also changed the Unity Project Settings --> Configuration --> API Compatiblity Level --> .NET 4.x

Hope this will fix your compile errors.

Cheers Mom0

SneakyAzWhat commented 3 years ago

@Mom0aut I just ended up switching to 2019 LTS with the 1.0.0 release candidate for the time being. Thanks for the heads up though.

swiftyspiffy commented 3 years ago

New TwitchLib.Unity release is out. Can you guys see if you still have these issues with it?

Thanks :)

SneakyAzWhat commented 3 years ago

@swiftyspiffy I am using Unity 2019.4.18f1 LTS. I created a new 2D project -> created a plugins folder and added the twitchlib.unity dll from the latest release into the folder. I received the same error from my initial post. I also tried changing my API compatibility level from '.NET Standard 2.0' to '.NET 4.x' and still have the error.

If it works for you and some other people then maybe I am missing something here.

EDIT: Confirmed the same problem on 2020.2.2f1 Unity version as well. Downloading zip, extracting, putting TwitchLib.Unity.dll into plugins folder within assets folder.

swiftyspiffy commented 3 years ago

Can you get away with just bringing in the TwitchLib.Unity.dll file? For me, I had to have all of the TwitchLib dlls, as well as the Unity one. The Unity dll acts as a sort of proxy to the rest of the library.

SneakyAzWhat commented 3 years ago

For my temp solution I have been using unity 2019 LTS with this https://github.com/TwitchLib/TwitchLib.Unity/releases/tag/1.0.0 unity.dll file only. If I need to use the other stuff to make it work I don't mind doing that, I was just under the impression from other projects people have made in the past that I only needed the TwitchLib.Unity.dll. In my current project it works by itself and I have accessed both the client and api from it.

SneakyAzWhat commented 3 years ago

This problem is a result of the more recent releases (anything after RC 1.0.0) not being bundled with TwitchLib into a single .dll . I incorrectly assumed the release was bundled without taking the time to verify. Anyone having this problem just needs to download the latest release TwitchLib.Unity zip -> create a 'Plugins' folder within your assets folder -> copy the contents from your TwitchLib.Unity zip folder into that newly created Plugins folder. Thanks swifty for updating this repo for us 👍