question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MLAPI after setting up game for Unit Tests

See original GitHub issue

I’m attempting to setup a PlayMode Unit Test using Test Runner.

UPDATE: Downgrading to Unity 2019 resolves.

Describe the bug Field `MLAPI.NetworkManager:__ntable’ is inaccessible from a Unity Assembly Definition

To Reproduce In a simple scene using MLAPI with a NetworkManager and a NetworkObject -

  1. Open Test Runner
  2. Create a PlayMode Test Assembly Folder
  3. Create Test Script in current Folder
  4. From the Project window, Create a Assembly Definition, name it “Scripts”
  5. On the new “Scripts” Assembly definition Add com,unity.multiplayer.mlapi.runtime as a Assembly Definition Reference
  6. Run, you’ll then get the error - FieldAccessException: Field MLAPI.NetworkManager:__ntable' is inaccessible from method xxxx.xxxx:.cctor ()’

Rethrow as TypeInitializationException: The type initializer for ‘xxxx.xxxx’ threw an exception.

Deleting the “Scripts” Assembly Definition returns things to working order.

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2020.3.2.f1
  • MLAPI Version: 0.1.0
  • MLAPI Commit:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jmguillemettecommented, May 31, 2021

i have started a fresh 2020.x workspace and am slowly porting my code and unit tests over. so far I have not encountered this bug. So it may very well be an upgrade related issue. will keep this ticket updated as I go.

1reaction
ThusSpokeNomadcommented, Apr 13, 2021

@blabz2007 — I’m still not able to reproduce this issue on 2020.3.2f1 with MLAPI 0.1.0 release. Please can you send the full project zipped so that I can have a better look and understand what’s the problem? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

MLAPI after setting up game for Unit Tests · Issue #704
I'm attempting to setup a PlayMode Unit Test using Test Runner. UPDATE: Downgrading to Unity 2019 resolves. Describe the bug Field `MLAPI.
Read more >
Unity MLAPI Multiplayer Tutorials - Complete Guide
As such, whether you're looking to explore additional multiplayer game methods or want to expand your skills, mastering Unity MLAPI opens up ......
Read more >
Testing multiplayer games locally
Testing a multiplayer game presents unique challenges: You need to run multiple instances of the game to test multiplayer scenarios. You also ...
Read more >
MLAPI Tutorial: Part 7- Play Over Network - YouTube
... so we can check that the client trying to connect is actually using the same game code. ... MLAPI Tutorial: Part 7-...
Read more >
Testing network multiplayer game - Unity Forum
Hi! I am trying to figure how I could create automation test for a network multiplayer game (actually, also in VR but maybe...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found