dll is not allowed to be included or could not be found" error unity3d for android

Hello,

I am getting following error while building project for android platform.

ArgumentException: The Assembly System.Configuration is referenced by System.Data. But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String paths, System.String foldersToSearch)
UnityEditor.HostView:OnGUI()

Please help me if you any idea for this error

Regards,
Nandan

8 Answers

8

Two things to try:

  1. Add System.Configuration.dll your Plugins folder.
  2. In Build Settings > Player Settings > API Compatibility Level, change the .NET setting.

Then try to build again and see if the error goes away or changes.

@TonyLi I am also facing the same but the above answer does not solved my problem.Can you please help me ?

What's the error?

same as above which is in question.

What happens if you try to build for desktop?

I change it from .NET sub 2.0 to .NET. And it worked thanks! Although my concern would be what will be effected upon changing this.

change options in Unity, player setting, oter settings:
Api compatibility level:
.Net 2.0

yea this worked instead of using the .Net 2.0 subset .Net 2.0 worked

沒錯Build Settings > Player Settings > API Compatibility Level, change the .NET setting to .Net 2.0 就好了

I changed the API Compatibility Level to .NET 2.0. The project will now build for desktop, Win 64, and Android. But it will not Build and Run for Android as it returns the same error referenced in the original post of this thread. Any thoughts on that.

ArgumentException: The Assembly RestSharp.Net2 is referenced by ClassLibrary1 (‘Assets/Plugins/Bin/ClassLibrary1.dll’). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:146)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:152)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String paths, System.String foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:184)
UnityEditor.HostView:OnGUI()…

am still having the issue…tried in your ways…but dint work for me…is there any thing wrong with DLL scripts ?

May be you are use namespace “UnityEditor” in DLL. Remove it

The player settings change to Net 2.0 worked for me. Thank you very much!

Thank you very much, also helped me to my, the change to .Net 2.0