ArgumentException: The Assembly ICSharpCode.SharpZipLib is referenced by NPOI. But the dll is not allowed to be included or could not be found

 I was doing Unity iOS deployment and found that the build xCode Export was failing due to the below-given (ArgumentException: The Assembly ICSharpCode.SharpZipLib is referenced by NPOI) error:


ArgumentException: The Assembly ICSharpCode.SharpZipLib is referenced by NPOI ('Assets/Uni-Excel/Plugins/NPOI.dll'). But the dll is not allowed to be included or could not be found. UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at <44a70d1b13cf47e29810e30f45ffae08>:0) UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at <44a70d1b13cf47e29810e30f45ffae08>:0) UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at <44a70d1b13cf47e29810e30f45ffae08>:0) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)



The same unity project was okay when I was deploying for standalone and even for the android platform. But it was strange the same project was failing when built for iOS. Then, I make some investigation and found that my project was using the Uni-Excel package it has an NPOI DLL file that is using ICSharpCode.SharpZipLib as a dependency. And somehow I don't know why it is not exporting SharpZipLib when we are building for iOS. 

Solution

In order to resolve this error, I copied ICSharpCode.SharpZipLib dll from the unity installation folder located at

C:\Program Files\Unity\Hub\Editor\2020.3.8f1\Editor\Data\MonoBleedingEdge\lib\mono\gac\ICSharpCode.SharpZipLib\4.84.0.0__1b03e6acf1164f73

and put it inside my Plugins folder. Then, I build it for iOS and it exported the XCode without any error.

I don't know why it is not working by default in Unity iOS platfrom.


#UnityBugResolve

Post a Comment

0 Comments