Repository navigation
Closed
Milestone
Description
Steps to Reproduce
- git clone https://github.com/xamarin/xamarin-android.git
- cd xamarin-android
- make prepare
- make
Expected Behavior
make should run through without errors.
Actual Behavior
The build process fails after a while. There are several warnings here and there, but the first actual error seems to be:
AfterBuild:
CheckApiCompatibility for ApiLevel: v10.0
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: The "CheckApiCompatibility" task failed unexpectedly. [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: System.DllNotFoundException: lib64/libzip.so assembly:<unknown assembly> type:<unknown type> member:(null) [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: at (wrapper managed-to-native) Xamarin.Tools.Zip.Native.zip_open(intptr,Xamarin.Tools.Zip.OpenFlags,Xamarin.Tools.Zip.ErrorCode&) [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: at Xamarin.Tools.Zip.Native.zip_open (System.String path, Xamarin.Tools.Zip.OpenFlags flags, Xamarin.Tools.Zip.ErrorCode& errorp) [0x00007] in /Users/runner/runners/2.160.0/work/1/s/Native.cs:84 [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: at Xamarin.Tools.Zip.ZipArchive.Open (System.String path, Xamarin.Tools.Zip.OpenFlags flags) [0x00009] in /Users/runner/runners/2.160.0/work/1/s/ZipArchive.cs:158 [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: at Xamarin.Tools.Zip.ZipArchive.Open (System.String path, System.IO.FileMode mode, System.String defaultExtractionDir, System.Boolean strictConsistencyChecks, Xamarin.Tools.Zip.IPlatformOptions options) [0x0005a] in /Users/runner/runners/2.160.0/work/1/s/ZipArchive.cs:229 [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: at Xamarin.Android.Tools.BootstrapTasks.CheckApiCompatibility.Execute () [0x00169] in /home/janus/github/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckApiCompatibility.cs:98 [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.targets(175,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002a9] in <b695b16788dd418cbe8b4d98f7a92ff3>:0 [/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj]
Done Building Project "/home/janus/github/xamarin-android/src/Mono.Android/Mono.Android.csproj" (default targets) -- FAILED.
Version Information
- xamarin-android version: master as of 2020-01-08 (commit 9530fd0)
- OS: Ubuntu Linux 16.04 (xenial)
- Mono version: 6.4.0.198
- msbuild version: Microsoft (R)-Build-Engine, Version 16.3.0-ci für Mono
Log File
If necessary I can attach the full build log or provide further information. Please let me know what exactly is needed ...
Metadata
Metadata
Assignees
Labels
No labels
Activity
janusw commentedon Jan 8, 2020
Note:
make preparehas been failing on Ubunt 16.04 until recently, but works now (after #4082 has been fixed).janusw commentedon Jan 8, 2020
libzip.so exists on my system in the following paths:
Apart from those, it also exists twice in the xamarin-android build directory:
The first of those two is the the only instance where it lives inside a
lib64directory, as indicated in the error.Thus I would conclude that the file is present. I'm not sure why it isn't found.
dellis1972 commentedon Jan 9, 2020
I'll try to repo this issue on a Linux VM I have.
In the mean time it might be useful to get some diagnostics from mono as to where it is trying to load the libzip.so file from.
When doing the
makestep can you try the followingthis will produce a HUGE amount of data. But around where the error is raised you might be able to see where mono is searching for the native library.
janusw commentedon Jan 9, 2020
Thanks for the hint, and here you go:
janusw commentedon Jan 9, 2020
Taking a closer look at this log snippet, the first relevant error seems to be:
The only
libcrypto.so*on my entire system is ...... and there is no libcryto in the build folder.
Apart from this, there is also a second error that might be relevant:
There is no folder
/usr/lib/lib64on Ubuntu 16.04.dellis1972 commentedon Jan 10, 2020
I just tried to repo this on Ubuntu 18.04 and did not get the same issue.
You are running on a 64 bit machine right?
I also have
/lib/x86_64-linux-gnu/libcrypto.so.1.0.0on my machine.So the other thing to do is the check all its dependencies are installed, can you check the results of the following.
you should get something like
It will let you know if any of those are missing. It might also be worth checking the 32 bit version too
janusw commentedon Jan 10, 2020
Are you saying that you can build xamarin-android on bionic without errors? Or that you get different errors?
Yes, x86_64-linux-gnu.
Apparently both have a wrong reference to
libcrypto.so.1.1. My system only haslibcrypto.so.1.0.0.Note that my Ubuntu-provided libzip has no reference to libcrypto at all:
dellis1972 commentedon Jan 10, 2020
I managed to build the entire repo without any issues (apart from missing java in my PATH).
ok so its definitely libcrypto.so. Which is odd because I have that 1.1 version of that installed.
Do you need to run
sudo apt-get updateandsudo apt-get upgrade?janusw commentedon Jan 10, 2020
Good to know. Maybe I should just update from 16.04 to 18.04, in order to make my life easier. OTOH Ubuntu 16.04 will still be supported for more than a year, so it would be great if xamarin-android could be convinced to build on that system.
What's so odd about that? You have 18.04 with libcryto 1.1 and the build succeeds, while I have 16.04 with libcrypto 1.0 and the build fails (since xamarin-android seems to expect version 1.1?).
No, all packages are up to date.
janusw commentedon Jan 10, 2020
Investigating a bit further:
Since xamarin-android currently seems to require libssl1.1, that probably should be checked in
make prepareat least. Or maybe one can even make the build work with libssl1.0.0 as well?grendello commentedon Jan 10, 2020
Since
libzip.socomes from the nuget, we must simply link libcrypto statically into it and make sure thatlibzip.sodynamically references onlylibc. This will make the library the most compatible with any distro that has the samelibcversion.janusw commentedon Jan 11, 2020
This one? https://www.nuget.org/packages/libzip/
As an alternative, how about relying on Ubuntu's
libzip.so? (On Ubuntu 16.04, apt has the packagelibzip4in version 1.0.1; on 18.04, the version is 1.1.2.) This will also make sure that all dynamical references are present.grendello commentedon Jan 13, 2020
@janusw we used to rely on the OS copy of
libzipbut it poses a number of problems. First, we can't rely onlibzip.sobeing there - it would exist only if the user installed the development packages. Second, only the latest distributions havelibzip.so.5, the older ones havelibzip.so.4and dealing with this is way too involved to justify. Linking libcrypto statically into libzip (or even dropping encryption support completely, perhaps) is the easiest way to deal with it.dellis1972 commentedon Jan 13, 2020
I created a new issue on our LibZipSharp repo so track this issue. This is because we ship libzip as part of the LibZipSharp Nuget Package. We will close that upstream issue once we have published a new version, then use this issue to track upgrading the Nuget Package within Xamarin.Android.
dotnet/android-libzipsharp#42
dellis1972 commentedon Jan 13, 2020
PR up dotnet/android-libzipsharp#44
janusw commentedon Jan 13, 2020
Well, it seems like
make preparecurrently does include a check for exactly that (libzip-dev). This is the output I see on Ubuntu 16.04:So, if you guys decide that depending on LibZipSharp instead of the system libzip is the way to go, then I guess this check could be removed? Or is there another reason why it is required?
dellis1972 commentedon Jan 13, 2020
libzip-devwas being referenced because we used to buildlibzip.soas part of the Xamarin.android repo. However we recently moved all of that over to theLibZipSharpRepo and Nuget Package so the other projects can make use of it. This is just left over from the old process, it will be removed in the near future.grendello commentedon Jan 14, 2020
#4122 removes dependency on
libzip-devfor Linux distros based on Debianjanusw commentedon Jan 16, 2020
Thanks!
Since dotnet/android-libzipsharp#44 has been merged already, I guess we're now waiting for dotnet/android-libzipsharp#45, so that we have a new release of LibZipSharp, which can be used in xamarin-android ...
[Build] Bump Xamarin.LibZipSharp to 1.0.7
[Build] Bump Xamarin.LibZipSharp to 1.0.7 (#4147)