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

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.

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

沒錯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