Zenject icon indicating copy to clipboard operation
Zenject copied to clipboard

Reflection Baking Invalid Path ERROR

Open wewrere41 opened this issue 5 years ago • 3 comments

Describe the bug Reflection Baking not working.

To Reproduce

Create a new project Add zenject Create ZenjectReflectionBakingSettings Take android build Expected behavior NO ERROR

Screenshots PangoBright_yMrAyHa0R3

EDITOR Create a new project Add zenject Create ZenjectReflectionBakingSettings Tick In Enabled In Editor PangoBright_rbCR9NDDHv

Screenshots PangoBright_X2tmmVEHaR

Extenject and Unity info (please complete the following information):

  • Zenject version:9.2
  • Unity version:2020.1.4f1
  • Project's scripting backend [IL2CPP]

Additional context Add any other context about the problem here.

wewrere41 avatar Nov 24 '20 17:11 wewrere41

Hello there,

first of all, I'm not an Extenject developer, but just another user myself.

Looking at the code, it looks like this exception occurs if there's an assembly that currently doesn't exist in the file system, or that for another reason points to an invalid location (e. g. Unity constructing special paths for in-memory files).

In my simple test (deviates slightly from your reproduction steps), I wasn't able to observe this issue. In order to eliminate differences based on the local environment, could you please provide the following information:

  • what's your operating system? (Windows or Linux? paths are represented differently)
  • does the path to your project contain any non-alpha-numeric characters other than the system-specific directory separator character (\ on Windows, / on others)?
  • Do you have any Assembly Defenition Files in your project?
  • Does the behavior change if you alter the Api Compatibility Level to .NET 4.x (Project Settings -> Other Settings -> Configuration)?

Background for these questions: it's possible that you're observing these issues since your project or a temporary folder used by Unity uses a path that the .Net libraries interpret as invalid. This can particularly be the case if it's an issue related to the operating system and differences in its path handling.

I'll probably try to reproduce this issue later using IL2CPP myself (I don't have the right setup to do so just yet). In case I'm not able to reproduce this issue: could you please do the following steps and post your results here?

  • Open Plugins/OptionalExtras/ReflectionBaking/Unity/UnityAssemblyResolver.cs
  • add UnityEngine.Debug.LogFormat("assembly at index {0}: {1} (location: {2}, null? {3})", i, assemblies[i], assemblies[i].Location, assemblies[i].Location != null); in the constructor right above AddSearchDirectory(Path.GetDirectoryName(assemblies[i].Location));
  • reproduce the error messages
  • observe the last log message right above the exception.

RichardWepner avatar Dec 28 '20 05:12 RichardWepner

Windows10 19042.630 Path: C:\Kodlama\UnityProjects\TestTemplate\Assets\3rd Party\Plugins\Zenject No Same error again

Unity_DbZwT8GZXX

wewrere41 avatar Dec 28 '20 11:12 wewrere41

Seems like it's caused by the Rider Unity Package

revolt3r avatar Oct 05 '21 09:10 revolt3r