Bug 44667 - ResolveLibraryProjectImports failed for looking LibZipSharp.dll
Summary: ResolveLibraryProjectImports failed for looking LibZipSharp.dll
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 7.0 (C8)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: dean.ellis
: 45897 ()
Depends on:
Reported: 2016-09-23 04:21 UTC by Yaojian
Modified: 2016-10-26 14:33 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

The build output (328.97 KB, text/plain)
2016-09-23 04:21 UTC, Yaojian
Files in /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild/Xamarin/Android (2.48 KB, text/plain)
2016-09-23 04:28 UTC, Yaojian

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Yaojian 2016-09-23 04:21:53 UTC
Created attachment 17704 [details]
The build output

Steps to reproduce:

1. Choose "File/New Solution" and select "Multiplatform/App/Xamarin.Forms/Forms App"
2. On "Configure your Forms app":
  name the project as "PclHelloWorld"
  check the target platform for both "Android" and "iOS",
  select "Use Portable Class Library"
  check "Use XAML for user interface files"
3. Generate the project.

Error 1:

Xamarin Studio show following error in pad "ResGen":

Error executing task ResolveLibraryProjectImports: Could not load file or assembly or one of its dependencies.

Error 2:

Building of "PclHelloWorld.Droid" fails with the following error :

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: error : Error executing task ResolveLibraryProjectImports: Could not load file or assembly or one of its dependencies.
		Error executing task ResolveLibraryProjectImports: System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies.
File name: 'libZipSharp, Version=1.0.6099.33510, Culture=neutral, PublicKeyToken=null'
  at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute () [0x000c6] in <ed6f05cfdfa24159a239bb1396141854>:0 
  at Microsoft.Build.BuildEngine.TaskEngine.Execute () [0x00000] in <b1524340ac7e4c06b22fac1b2db62c08>:0 
  at Microsoft.Build.BuildEngine.BuildTask.Execute () [0x0008f] in <b1524340ac7e4c06b22fac1b2db62c08>:0

I checked the directory `/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild/Xamarin/Android` and find there is a `LibZipSharp.dll`, which the file name is in a different letter case. 

I tried to rename `LibZipSharp.dll` as `libZipSharp.dll` but the same error still occurs.

Xamarin Studio : 6.1 (build 5441)
OS: OSX EI Captain with case-sensitive file system
Comment 1 Yaojian 2016-09-23 04:28:37 UTC
Created attachment 17705 [details]
Files in /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild/Xamarin/Android

Add file list in an attachment for /Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild/Xamarin/Android
Comment 2 dean.ellis 2016-09-23 09:21:47 UTC
Can you check that all the dependencies for libzip.3.0.dylib are being met.

otool -L libzip.3.0.dylib 

I'm not sure how much testing we have done on OSX with a case-sensitive file system as its not the default.
Comment 3 dean.ellis 2016-09-23 09:23:04 UTC
also try renaming the LibZipSharp.dll.config as well. They will probably both need to be the same casing.
Comment 4 Yaojian 2016-09-23 09:24:33 UTC
	/Library/Frameworks/Xamarin.Android.framework/Versions/7.0.0-18/lib/xbuild/Xamarin/Android/libzip.3.0.dylib (compatibility version 3.0.0, current version 3.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

BTW, I renamed LibZipSharp.dll and LibZipSharp.dll.config and no luck.
Comment 5 dean.ellis 2016-09-23 10:10:55 UTC
Have you restarted XS since renaming the files? I assume so.
Comment 6 Yaojian 2016-09-24 00:20:40 UTC
Oh, thanks. Restart XS works after renaming files.

Before seeing your comment, I renamed files to libZipSharp.* and renamed them back to LibZipSharp.* without restarting XS.
Comment 7 Yaojian 2016-09-24 00:21:45 UTC
Just a note, XS 6.0 does NOT have this issue.
Comment 8 dean.ellis 2016-09-26 09:30:50 UTC
Fixed in monodroid/master/6982512d
Comment 9 dean.ellis 2016-10-26 14:33:41 UTC
*** Bug 45897 has been marked as a duplicate of this bug. ***