Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error with Unity 5.3.5p8 #12

Open
Godefroy opened this issue Jul 19, 2016 · 9 comments
Open

Compilation error with Unity 5.3.5p8 #12

Godefroy opened this issue Jul 19, 2016 · 9 comments

Comments

@Godefroy
Copy link

Hi !

This compiler seems really promising but I've got an error with Unity 5.3.5p8 which prevents me from using it:

Client log :

2016-07-19 19:33:53.8412 INFO|Client|Request to server|
2016-07-19 19:33:59.2131 ERROR|Client|Error in request|System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail] : La référence d'objet n'est pas définie à une instance d'un objet. (le détail de l'erreur est égal à ExceptionDetail, probablement créé par IncludeExceptionDetailInFaults=True, dont la valeur est :
System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à IncrementalCompiler.Compiler.GetDiagnosticString(Diagnostic diagnostic, String type)
   à IncrementalCompiler.Compiler.Emit(CompileResult result)
   à IncrementalCompiler.Compiler.BuildFull(CompileOptions options)
   à IncrementalCompiler.Compiler.Build(CompileOptions options)
   à IncrementalCompiler.CompilerService.Build(String projectPath, CompileOptions options)
   à SyncInvokeBuild(Object , Object[] , Object[] )
   à System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
   à System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
   à System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
   à System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc)...).
2016-07-19 19:34:01.0597 INFO|Client|Done: Succeeded=True. Duration=7,215534sec.|

Server log :

2016-07-19 19:33:59.1690 ERROR|CompilerService|Error in build.|System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à IncrementalCompiler.Compiler.GetDiagnosticString(Diagnostic diagnostic, String type)
   à IncrementalCompiler.Compiler.Emit(CompileResult result)
   à IncrementalCompiler.Compiler.BuildFull(CompileOptions options)
   à IncrementalCompiler.Compiler.Build(CompileOptions options)
   à IncrementalCompiler.CompilerService.Build(String projectPath, CompileOptions options)

Do you have an idea of how to fix this?

@Godefroy
Copy link
Author

Hmm it seems to work with another project. I don't know how to find what's causing the issue on my first project.

@veblush
Copy link
Contributor

veblush commented Jul 19, 2016

When the compiler encounters an error while compile, it generates error messages. But this exception seems to be thrown by GetDiagnosticString which does not handle null of fields of Diagnostic carrying error information. I'll make a fix for it. Thanks!

@veblush
Copy link
Contributor

veblush commented Jul 20, 2016

This fix is just done. Please check it out. latest release.
If this works, let me know what kind of message start with 'None`.

@Godefroy
Copy link
Author

Wow you're fast, thanks a lot!
I'm testing that.

@Godefroy
Copy link
Author

Godefroy commented Jul 20, 2016

I think we now have a hint:

IncrementalCompiler.log:

2016-07-20 10:03:32.3074 INFO|Client|None: warning CS1685: The predefined type 'ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'|

Compilation finishes, no error in any log except this warning, but the dll is invalid.

In Unity3D:

UNetWeaver error: Exception :System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
  at Mono.Cecil.PE.ImageReader.ReadImage () [0x00000] in <filename unknown>:0 
  at Mono.Cecil.PE.ImageReader.ReadImageFrom (System.IO.Stream stream) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.IO.Stream stream, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at Mono.Cecil.AssemblyDefinition.ReadAssembly (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00000] in <filename unknown>:0 
  at Unity.UNetWeaver.Weaver.Weave (System.String assName, IEnumerable`1 dependencies, IAssemblyResolver assemblyResolver, System.String unityEngineDLLPath, System.String unityUNetDLLPath, System.String outputDir) [0x00032] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1640 
  at Unity.UNetWeaver.Weaver.WeaveAssemblies (IEnumerable`1 assemblies, IEnumerable`1 dependencies, IAssemblyResolver assemblyResolver, System.String outputDir, System.String unityEngineDLLPath, System.String unityUNetDLLPath) [0x00062] in C:\buildslave\unity\build\Extensions\Networking\Weaver\UNetWeaver.cs:1753 
UnityEngine.Debug:LogError(Object)
Unity.UNetWeaver.Log:Error(String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20)
Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable`1, IEnumerable`1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1760)
Unity.UNetWeaver.Program:Process(String, String, String, String[], String[], IAssemblyResolver, Action`1, Action`1) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:34)
UnityEditor.Scripting.Serialization.Weaver:WeaveUnetFromEditor(String, String, String, String, Boolean)

@veblush
Copy link
Contributor

veblush commented Jul 20, 2016

Wow it's a bizarre warning that I've never seen. At first, is there a suspicious DLL in your project? From stackoverflow, it's possible to have DLLs targeting different framework in your case.

Which DLL does Unity3D cannot load? Is it an Assembly-CSharp.dll in ./Library/ScriptAssemblies or something else. And is it an zero-size DLL?

@Godefroy
Copy link
Author

Ok now it's working when I remove two extensions:

  • Slate (by ParadoxNotion)
  • Online Maps (by Infinity Code)

Error with Online Maps:

The type 'XmlElement' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.

@veblush
Copy link
Contributor

veblush commented Jul 24, 2016

It's good to be working now. 😄 But I cannot try to find what's wrong with them because they're not free.

For error about XmlElement, Incremental Compiler always refers to System.Xml, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e so it's strange to have this error. Any idea about Online Map package?

@00christian00
Copy link

Slate do work fine. I can't test Online Maps, but I remember a similar error on normal Unity too.
Do you perhaps have .NET 2.0 subset selected in the player setting? It may be the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants