Xamarin-android: Continued Linux support?

Created on 11 Sep 2018  Â·  56Comments  Â·  Source: xamarin/xamarin-android

I noticed the Azure artifacts haven't been updated in almost four months now. Our team relies on this for testing our app and we are wondering what the fate of the project is. We are concerned support will break for v8.3.99.189

I looked through one of the build logs and the error messages don't seem that horrible. Mostly stuff with nunit? It turns into some failed downloads after what's quoted, maybe because it failed to build?

@jonpryor @atsushieno
I'm hoping someone can look into this or give us clues as to what's missing in the build environment and we can try ourselves. Thanks

16:15:05 Build FAILED.
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/xa-prep-tasks/xa-prep-tasks.csproj" (default target) (2:2) ->
16:15:05 (ResolveAssemblyReferences target) -> 
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3277: Found conflicts between different versions of "System.IO.Compression" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/xa-prep-tasks/xa-prep-tasks.csproj]
16:15:05 
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/android-toolchain/android-toolchain.csproj" (default target) (3:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj" (default target) (7:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj" (default target) (8:2) ->
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.engine". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.engine.api". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit-agent". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit-agent-x86". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05 
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/android-toolchain/android-toolchain.csproj" (default target) (3:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj" (default target) (7:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj" (default target) (8:2) ->
16:15:05 (CoreCompile target) -> 
16:15:05   Native.cs(44,18): warning CS0649: Field 'Native.zip_source_args_seek_t.offset' is never assigned to, and will always have its default value 0 [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05   Native.cs(45,15): warning CS0649: Field 'Native.zip_source_args_seek_t.whence' is never assigned to, and will always have its default value 0 [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05 
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/android-toolchain/android-toolchain.csproj" (default target) (3:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj" (default target) (7:2) ->
16:15:05 (ResolveAssemblyReferences target) -> 
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3277: Found conflicts between different versions of "System.IO.Compression" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj]
16:15:05 
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/android-toolchain/android-toolchain.csproj" (default target) (3:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj" (default target) (7:2) ->
16:15:05 (CoreCompile target) -> 
16:15:05   Xamarin.Android.Tools.BootstrapTasks/RunUITests.cs(18,26): warning CS0114: 'RunUITests.AfterCommand(int, Adb.CommandInfo)' hides inherited member 'Adb.AfterCommand(int, Adb.CommandInfo)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj]
16:15:05   Xamarin.Android.Tools.BootstrapTasks/RunInstrumentationTests.cs(42,27): warning CS0169: The field 'RunInstrumentationTests.logcatWriter' is never used [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj]
16:15:05 
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/android-toolchain/android-toolchain.csproj" (default target) (3:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj" (default target) (7:3) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj" (default target) (8:6) ->
16:15:05 (ResolveAssemblyReferences target) -> 
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.engine". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit.engine.api". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit-agent". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "nunit-agent-x86". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/external/LibZipSharp/libZipSharp.csproj]
16:15:05 
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/android-toolchain/android-toolchain.csproj" (default target) (3:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj" (default target) (7:3) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/xa-prep-tasks/xa-prep-tasks.csproj" (default target) (2:15) ->
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3277: Found conflicts between different versions of "System.IO.Compression" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/xa-prep-tasks/xa-prep-tasks.csproj]
16:15:05 
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/android-toolchain/android-toolchain.csproj" (default target) (3:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj" (default target) (7:3) ->
16:15:05   /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3277: Found conflicts between different versions of "System.IO.Compression" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj]
16:15:05 
16:15:05 
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/mono-runtimes.csproj" (default target) (1) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/android-toolchain/android-toolchain.csproj" (default target) (3:2) ->
16:15:05 "/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj" (default target) (7:3) ->
16:15:05 (CoreCompile target) -> 
16:15:05   Xamarin.Android.Tools.BootstrapTasks/RunUITests.cs(18,26): warning CS0114: 'RunUITests.AfterCommand(int, Adb.CommandInfo)' hides inherited member 'Adb.AfterCommand(int, Adb.CommandInfo)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj]
16:15:05   Xamarin.Android.Tools.BootstrapTasks/RunInstrumentationTests.cs(42,27): warning CS0169: The field 'RunInstrumentationTests.logcatWriter' is never used [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks.csproj]

Most helpful comment

Good news (finally), we have some green builds on Linux https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux-release/
This bot doesn't run tests, just produces packages. The other bot is currently locked up while running console tests, but that means the build succeeded. We'll get a green build there too, eventually.

All 56 comments

(I'm outsider now and have the same kind of concern.)

Same, and I filed a similar issue here: https://github.com/xamarin/xamarin-android/issues/2009

I managed to complete the make prepare and make. Not sure how to generate the .deb file, I will be trying make jenkins when i have more time.

I think the test solution is a goner due to issues we should take up with nuget. It failed to do a restore even with msbuild /t:restore /p:AndroidSdkDirectory=/home/android/sdk. I have tried using the latest nuget.exe as an alias, and the nuget binary provided in the apt archives.

Fwiw, the make prepare installed almost everything I needed. Only had to go through the errors once to see that cmake was missing as a dependency install.

hit a roadblock with make jenkins, let me know if anyone figures a way around
version control

$ git show
commit 24158d08be1db5a45dfd2ebfe8c05a85bfa8af00 (HEAD -> master, origin/master, origin/HEAD)
Author: Jonathan Pryor <[email protected]>
Date:   Fri Sep 14 04:56:57 2018 -0400

    [build] Build Xamarin.Android.NUnitLite.dll for API-28 (#2182)

this is it

"/media/shane/win10Home/xamarin_sdk/Xamarin.Android.sln" (default target) (1) ->
"/media/shane/win10Home/xamarin_sdk/src/mono-runtimes/mono-runtimes.csproj" (default target) (9) ->
"/media/shane/win10Home/xamarin_sdk/src/mono-runtimes/mono-runtimes.csproj" (ForceBuild target) (9:2) ->
(_BuildRuntimes target) ->
/media/shane/win10Home/xamarin_sdk/src/mono-runtimes/mono-runtimes.targets(287,5): error MSB3073: The command "make DISABLE_IOS=1 -j6 package-android-armeabi-v7a package-android-arm64-v8a package-android-x86 package-android-x86_64 package-android-host-Linux package-android-cross-arm package-android-cross-arm64 package-android-cross-x86 package-android-cross-x86_64 package-android-cross-arm-win package-android-cross-arm64-win package-android-cross-x86-win package-android-cross-x86_64-win CONFIGURATION=debug IGNORE_PROVISION_MXE=true IGNORE_PROVISION_ANDROID=true IGNORE_PACKAGE_LLVM=true ANDROID_TOOLCHAIN_DIR="/home/shane/android-toolchain" ANDROID_TOOLCHAIN_CACHE_DIR="/home/shane/android-archives" ANDROID_TOOLCHAIN_PREFIX="/home/shane/android-toolchain/toolchains" LLVM_SRC="/media/shane/win10Home/xamarin_sdk/src/mono-runtimes/../../external/llvm" MXE_PREFIX_DIR="/home/shane/android-toolchain" MXE_SRC="/media/shane/win10Home/xamarin_sdk/src/mono-runtimes/../../external/mxe"" exited with code 2. [/media/shane/win10Home/xamarin_sdk/src/mono-runtimes/mono-runtimes.csproj]

19 Warning(s)
1 Error(s)

Time Elapsed 00:00:41.28
build-tools/scripts/BuildEverything.mk:93: recipe for target 'leeroy-all' failed
make: * [leeroy-all] Error 1

Running the command manually gives this,
tr: warning: an unescaped backslash at end of string is not portable tr: warning: an unescaped backslash at end of string is not portable make: *** No rule to make target 'package-android-armeabi-v7a'. Stop.

make install is your best bet.

Even so you will have to manually copy the contents of the bin/Debug/ folder to /usr/local/bin, with some of the lib. Seems the make install doesn't copy over much of what's needed. Anyways still can't tell I'm on the latest build, but for this to work at all you run a command like
xabuild /t:signandroidpackage /p:configuration=Release /p:outputpath=bin/Release/

I compiled from a release tag
```
$ git log --stat
commit 6d7d8a4ae82e39997acb53b3791feef8f6b8da45 (HEAD, tag: xamarin-android-9.0.0.0)
Author: Dean Ellis dellis1972@googlemail.com
Date: Wed Jun 13 11:42:54 2018 -0700

.../Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs | 10 ++++++++++
.../Expected/GenerateDesignerFileExpected.cs | 16 ++++++++++++++++
.../Xamarin.Android.Build.Tests/ManagedResourceParserTests.cs | 6 ++++++
.../Utilities/ManagedResourceParser.cs | 2 ++
4 files changed, 34 insertions(+)```

Appears I am on a later build. With 8.3.99 I could never get NDK features, e.g. ahead of time assembling, to work. It's working now. But still something feels a little off, not sure it's that the apk files are suspiciously 30% bigger than mac/windows or the fact that I had to build this myself. Leaves much to be desired

You have face an error such as

error XA0001: Unsupported or invalid $(TargetFrameworkVersion) value of 'v8.1'. Please update your Project Options.

In which case I am finding the temporary solution as

cd /usr/lib/mono/xbuild-frameworks/MonoAndroid
sudo ln -s v9.0 v8.1

However now I am facing a new problem with /t:SignAndroidPackage, @jonpryor

The "BuildApk" task failed unexpectedly.
error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path "/usr/lib/mono/xbuild/Xamarin/Android/lib/x86_64/libmono-android.release.so".

Indeed that folder contains only these entries,

host-Linux
x86

so am wondering how to build x86_64 at all?

Thanks!

@gamesguru Has to do with this maybe?

"/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/download-bundle/download-bundle.csproj" (default target) (57) ->
(_DownloadBundle target) -> 
  /mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/download-bundle/download-bundle.targets(24,5): warning : Unable to download URL `https://xamjenkinsartifact.azureedge.net/mono-jenkins/xamarin-android/bin/Debug/bundle-v21-hbea802c7-Debug-Linux-libzip=b95cf3f,llvm=117a508,mono=ab3c897.zip` to `/home/builder/android-archives/bundle-v21-hbea802c7-Debug-Linux-libzip=b95cf3f,llvm=117a508,mono=ab3c897.zip`: 404 (Not Found) [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/download-bundle/download-bundle.csproj]
  /mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/download-bundle/download-bundle.targets(24,5): warning : 404 (Not Found) [/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/build-tools/download-bundle/download-bundle.csproj]

At what point are you seeing this, how early, what sub task, etc?

Indeed if the problem is changes in their file hosting, we are at their mercy. Meanwhile I have gone back to build on Darwin, and my boss is relieved by that

I was able to get it working by bending the rules. Install the 8.3.99 deb file, then install the source over top. The x86_64 folder provided by the 8.3 xamarin will work on what you built out of master. Or at least it did for me on a couple apps. I did not verify whether those apps install or launch, but they do build successfully

@gamesguru This wasn't from running locally. Went to the most recent build log: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux/1325/consoleText

and searched for Error(s). It's towards the end, the 11th match.

The warning mentioned in the previous comment should be ignorable: if the bundle*.zip file can't be downloaded, it "just means" that src/mono-runtimes will need to be built, and the build will take longer. That's all.

...except that's what's "causing" the build to fail on Jenkins: mono doesn't build:

_BuildLlvm:
  make DISABLE_IOS=1 -j4 package-llvm-llvm32 package-llvm-llvm64 package-llvm-llvmwin32 package-llvm-llvmwin64 CONFIGURATION=debug IGNORE_PROVISION_MXE=true IGNORE_PROVISION_ANDROID=true IGNORE_PROVISION_LLVM=true ANDROID_TOOLCHAIN_DIR="/home/builder/android-toolchain" ANDROID_TOOLCHAIN_CACHE_DIR="/home/builder/android-archives" ANDROID_TOOLCHAIN_PREFIX="/home/builder/android-toolchain/toolchains" LLVM_SRC="/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/../../external/llvm" MXE_PREFIX_DIR="/home/builder/android-toolchain" MXE_SRC="/mnt/jenkins/workspace/xamarin-android-linux/xamarin-android/src/mono-runtimes/../../external/mxe" llvm-llvm32_CC="gcc -m32 -mindirect-branch=thunk-inline -mfunction-return=thunk-inline" llvm-llvm32_CXX="g++ -m32 -mindirect-branch=thunk-inline -mfunction-return=thunk-inline" llvm-llvm64_CC="gcc -mindirect-branch=thunk-inline -mfunction-return=thunk-inline" llvm-llvm64_CXX="g++ -mindirect-branch=thunk-inline -mfunction-return=thunk-inline"
  ...
  /bin/bash: /usr/bin/i686-w64-mingw32-cmake: No such file or directory
  make[1]: *** [.stamp-llvm-llvmwin32-configure] Error 127
  llvm.mk:239: recipe for target '.stamp-llvm-llvmwin32-configure' failed
  make[1]: *** Waiting for unfinished jobs....
  /bin/bash: /usr/bin/x86_64-w64-mingw32-cmake: No such file or directory
  make[1]: *** [.stamp-llvm-llvmwin64-configure] Error 127
  llvm.mk:240: recipe for target '.stamp-llvm-llvmwin64-configure' failed
  ...
  xamarin-android/src/mono-runtimes/mono-runtimes.targets(163,5): error MSB3073: The command "make DISABLE_IOS=1 …" exited with code 2.

No mono, no build, and everyone is sad. :-(

This isn't entirely for lack of trying: @grendello often tries to get things building on Linux (38ad1392c5d2cce435a2567b99b8e6e64d747741, 1a922aacd59497cefd5758eaeb0ad4b162fae80e, c41faadefd97032ce9f19a20ac19e92b20828fa6, 30eea71177853a73ab07911d49be1c1707c300f0, ...) but, for reasons I don't understand, complete Linux support is difficult.

@grendello: Should we stop building the AOT cross-compilers on Linux? Would that at least allow some degree of "progress"? https://github.com/xamarin/xamarin-android/blob/f970cd50d2c19dcb4b62cc1dd1198c31cc10a2df/build-tools/scripts/BuildEverything.mk#L50-L64

It's also hilarious and astounding that the Linux PR builder is often green: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-anroid-linux-pr-builder/

It's "full" make jenkins builds which are problematic on Linux, not the smaller make all builds.

The only problem on Linux that I can reproduce is building of the Windows llvm:

/bin/bash: /usr/bin/i686-w64-mingw32-cmake: No such file or directory
  make[1]: *** [.stamp-llvm-llvmwin32-configure] Error 127

and that issue should be fixed by this commit. In general, the tip of the mono/2018-06 branch should make the build work, once this PR is in. Previously there have been issues building 32-bit llvm on 64-bit hosts which was fixed here and subsequently backported to all the relevant Mono branches. Other than those two, I don't see any issues with AOT cross compilers on Linux. Let's see what happens after we merge the Mono bump into master.

Ok thanks, I will pull that commit later this week. Is there a flag to disable building Windows binaries?

Meanwhile, are we certain there is nothing problematic in the make all and make install? It completes successfully here, i.e. only warnings, BUT seems to be missing components after the build?

Specifically I am trying to figure out why I don't have /usr/lib/mono/xbuild/Xamarin/Android/lib/x86_64/libmono-android.release.so, the x86_64 folder is missing entirely. When installing from the 8.3.99 Debian file, the folder does exist! Clearly Jenkins is generating assets for which my machine is failing.

Edit:

/xamarin-android/build-tools/scripts/RequiredPrograms.targets(22,5): error :
Missing dependency detected. For Linux we do not know how to install program `mono`, version >= 5.18.0.

    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:03.71
Makefile:112: recipe for target 'prepare-deps' failed
make: *** [prepare-deps] Error 1

Good news (finally), we have some green builds on Linux https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux-release/
This bot doesn't run tests, just produces packages. The other bot is currently locked up while running console tests, but that means the build succeeded. We'll get a green build there too, eventually.

@grendello Is there a place where the failing tests can be viewed?

It is too early to close the issue. I don't see any successful build from the Jenkins page linked from README.md: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux/

do you have 5.18 installed on your ubuntu system, or are you forcing it to try to build it from scratch?

I currently have 5.18 installed and am kicking off a fresh build. will update

I have Mono JIT compiler version 5.21.0 installed, built from source.

make prepare is done but failing to populate the android-toolchain folder with any assets.

/media/shane/RaptorMS/etc/git_clones/xamarin-android/build-tools/android-toolchain/android-toolchain.targets(46,5): error : Unable to download URL https://dl.google.com/android/repository/android-18_r02.zip to /media/shane/RaptorMS/etc/git_clones/xamarin-android/android-archives/android-18_r02.zip: 502 (Bad Gateway)

That's weird - my build passed that part. Since downloading is often flaky, try again, and if it still fails then check if the direct downloading from above works?

it failed twice now, i am not sure why. I tried it both my HOME and MsbuildThisdirectory

$ git show
commit ae093bf0a103863e9325afd7e2fedbff1b78648e (HEAD -> master, origin/master, origin/HEAD)
Author: Ludovic Henry <[email protected]>
Date:   Wed Oct 24 22:26:53 2018 -0400

    [build] Expunge use of CONFIGURATIONS (#2325)

curl is downloading manually fine.

The downloader is an MSBuild task called DownloadUri in build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks, and AFAIR the msbuild runs based on system mono and if your system mono cannot handle https then it might fail. Usually it just works, but there might be SSL/TLS issues with your setup. One possibility is mozroots --import may fix the problem.

It's working on the third attempt, not sure what was wrong but stay tuned please

ok, I built an APK with it and everything passes the initial checks with make all and make install

On a side note, make install does not put it in the right place on Linux, it puts it in /usr/local/lib/xamarin.android but what is wanted is /usr/lib/mono

It is the de facto standard make behavior to try to install to /usr/local instead of /usr. If there were /usr/local/bin/mono etc. then it should just work.

I could finally built xamarin-android successfully too. What was really required was git submodule foreach git submodule foreach git clean -xdf aside git submodule foreach git clean -xdf(!)

yes but msbuild doesn't look for anything local.

when i ran msbuild /t:signandroidpackage msbuild threw a target error that nothing exists in /usr/lib/mono. I manually moved the installed binaries and targets from local/lib/xamarin.android to lib/mono and the error was resolved

If later tonight I investigate the NDK, llvm, BundleAssemblies, and AoT issues, do we feel like those are deserving of a separate issue or do they belong under this umbrella?

as another aside, running the xabuild script produces some ugly xml on the terminal output? What is up with that.

It is a bit tricky and annoying situation - Microsoft/msbuild (or mono/msbuild) developers don't respect Linux and they don't offer make install setup. They don't even just build on standard Linux. I usually install msbuild package (which @directhex provides at the mono team) then copy the contents into my own setup prefix (in my case it is /devel). If you have /usr/local/bin/msbuild then the xamarin-android setup to /usr/local should just work.

Well the 8.3.99 debian package installs everything properly. I may consider putting msbuild in local as suggested.

It is not a big deal, I would like to have a proper install script but I understand the institution's (wrongful) stance on Linux. Getting it working what's coolest.

I will close the issue as soon as new debian files are posted on Jenkins. Please post if you notice it before me.

Do NDK/AoT troubles deserve a separate issue?

Do NDK/AoT troubles deserve a separate issue?

They do. AOT issue has been known forever though. For BundleAssemblies I have no idea (I believe it should just work, it worked when I worked on that several years ago when I was at Xamarin).

It builds, it installs.

fwir however the logcat throws an error and the app crashes, when you try to launch it. I will check later whether that is still the case, I would assume so

Ok it appears no one answered the question about the x86_64 folder? If you look at the modification times on these folders you can see only three are being built this morning, the others are from long ago when I installed the *.deb file on September 18th.

As I postulated earlier, the Jenkins build is generating assets for which my machine is falling locally. Is this just because make all differs from make jenkins or how can i obtain the missing folders?
We have

host-Linux
x86

We are missing

armeabi
x86_64

@NatElkins the master builder runs only a subset of tests for now (the host ones), but we'll work on running the full test suite next. You can see test results by going to https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android-linux/, finding the build you're interested in and then clicking the Test Results link.

yes but msbuild doesn't look for anything local.

when i ran msbuild /t:signandroidpackage msbuild threw a target error that nothing exists in /usr/lib/mono. I manually moved the installed binaries and targets from local/lib/xamarin.android to lib/mono and the error was resolved

You may open a new issue for this. I personally never run make install when working on master, instead I just create a bunch of symlinks (using my mono built from source and installed in my $HOME, too, so it's kind of special)

If later tonight I investigate the NDK, llvm, BundleAssemblies, and AoT issues, do we feel like those are deserving of a separate issue or do they belong under this umbrella?

I am able to build using make jenkins (which builds everything, the same way the bots do) but if you run into issues with these components, do open a separate issue for each of them.

as another aside, running the xabuild script produces some ugly xml on the terminal output? What is up with that.

This is ugly but expected, but for the real rationale you need to ask @jonpryor

Ok it appears no one answered the question about the x86_64 folder? If you look at the modification times on these folders you can see only three are being built this morning, the others are from long ago when I installed the *.deb file on September 18th.

As I postulated earlier, the Jenkins build is generating assets for which my machine is falling locally. Is this just because make all differs from make jenkins or how can i obtain the missing folders?
We have

host-Linux
x86

We are missing

armeabi
x86_64

armeabi is gone, the rest is not built by default you need to enable them in Configuration.Override.props

looks like the project got disabled, is that a not so subtle way of saying the team has given up on this?

I'd like to ideally have access to xamarin 10 so I can continue working on my app from my linux laptop when I'm by my windows machine. seems the newest version available is 9.2.99.172

Is there any way the community could help get this back up and running?

Guys, I really don't know what do you mean by "project got disabled" and "back up and running"? XA builds and works in Linux just fine. In master we recently stopped using the bundle on all the operating systems, Mono is downloaded prebuilt (using Mono archive), all you need to do is to make sure you have your repo checked out, submodules updated and then do:

make prepare all

and if you're missing build dependencies, first do

make PREPARE_AUTOPROVISION=1 prepare

If, for some reason, packages aren't installed (e.g. your distro is not supported or some other issue happens), you can see the dependencies here and if you want to add support for your distro, feel free to open a PR against xaprepare. You do NOT need to have a package for your distro to use Xamarin.Android on your Linux machine. All you need to do is to put the following directory in your path:

[PATH_TO_REPO_TREE]/bin/[CONFIGURATION]/bin

And then use xabuild wherever you'd normally use msbuild to build your projects. xabuild is a script which wraps msbuild in the way that everything works with non-installed Xamarin.Android tree.

You can use make jenkins to build everything, but it's a serious overkill. Xamarin.Android builds the latest supported API only (by default) but you can pass API_LEVEL=XY to your make prepare all and the chosen API level will be built.

Regarding packages. Some of them are created and uploaded here. Note, however, that the Linux build bots frequently fail because of external factors (the most common cause recently is SSL certificate errors from nuget.org). You can find Debian packaging scripts here if you want to create your own customized package :). Otherwise, try:

make CONFIGURATION=Release jenkins package-deb

If you encounter any errors - please file issues, open PRs etc. And that is the answer to your question @mletterle :)

Context: https://github.com/xamarin/xamarin-android/tree/master/build-tools/xaprepare
Context: https://github.com/xamarin/xamarin-android/blob/master/Documentation/building/unix/dependencies.md

Regarding packages. Some of them are created and uploaded here. Note, however, that the Linux build bots frequently fail because of external factors (the most common cause recently is SSL certificate errors from nuget.org).

The thing is that the latest Xamarin.Android is 10.0.99 whereas the latest Linux package on that link is 9.2.99, which is ages ago.

@atsushieno I know, the jenkins bots aren't the most reliable ones. We're considering moving them to Azure pipeline, like the rest of the lot. However, as you know, I work on Linux day-in-day-out and I'm pretty sure the stuff builds and works... :)

Yeah I'm sure it's only about Jenkins builds. To my experience migration to Azure Pipelines sounds good, it worked quite well until I had to import private repos that I don't manage. Good luck with that!

The "funny" thing about jenkins builds, if you look at them, a huge majority of PR builds is green, whereas the branch builds are mostly red I've looked at the latest failures and it appears the problem is in the Debian packaging scripts - they fell behind the changes in XA. I've just asked @directhex to take a look at that when he gets a chance. However, where the community can help is precisely this kind of issues - take a look at the failed build log, find the error and either try to fix it with a PR or ping me on Slack or by creating an issue here and assigning it to me. We have plenty on our plates and stuff tends to get pushed to the bottom of the stack, so I might (and I will) miss things, alas.

@grendello Oh I was able to build and install locally, that works great! The Jenkins job isn't failing though, it's not doing anything because the build job is disabled:

Project xamarin-android-linux
Xamarin.Android master Linux build
This project is currently disabled

The last ran job was on July 31st.

The assumption by looking at that is there is some factor that is preventing the Xamarin team from re-enabling that job and since it would be very handy to have up to date Azure artifacts from a central location, I was curious if there was anything we could do to help get that build project re-enabled.

Not to mention the xamarin-android-linux project being disabled is simply a bad look if nothing else. :)

@grendello maybe you can help me on this, I try to build it locally and I keep getting this error

"/home/ed/git/xamarin-android/Xamarin.Android.sln" (default target) (1) -> "/home/ed/git/xamarin-android/src/java-runtime/java-runtime.csproj" (default target) (6) -> (Build target) -> EXEC : Fatal error : Unable to find package java.lang in classpath or bootclasspath [/home/ed/git/xamarin-android/src/java-runtime/java-runtime.csproj]
/home/ed/git/xamarin-android/src/java-runtime/java-runtime.targets(39,3): error MSB3073: The command ""/usr/lib/jvm/java-8-openjdk-amd64/bin/javac" -d obj/Debug/release -bootclasspath "/home/ed/android-toolchain/sdk/platforms/android-29/android.jar":"/home/ed/git/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/java_runtime.jar" @obj/Debug/release.txt" exited with code 3. [/home/ed/git/xamarin-android/src/java-runtime/java-runtime.csproj]

I tried various things and this is just alluding me on what I'm missing or doing wrong. I'm following the instructions on the repo.

@grendello Oh I was able to build and install locally, that works great! The Jenkins job isn't failing though, it's not doing _anything_ because the build job is disabled:

Project xamarin-android-linux
Xamarin.Android master Linux build
This project is currently disabled

The jobs that are used are as follows:

The last ran job was on July 31st.

The assumption by looking at that is there is some factor that is preventing the Xamarin team from re-enabling that job and since it would be very handy to have up to date Azure artifacts from a central location, I was curious if there was anything we could do to help get that build project re-enabled.

We've been changing a lot of stuff build-wise in the past 6-7 months and Linux will get the treatment too :)

Not to mention the xamarin-android-linux project being disabled is simply a bad _look_ if nothing else. :)

Yeah, I can see that. However, we're now considering moving away from Jenkins and so I hope we'll have something more stable in a near future

@grendello maybe you can help me on this, I try to build it locally and I keep getting this error

"/home/ed/git/xamarin-android/Xamarin.Android.sln" (default target) (1) -> "/home/ed/git/xamarin-android/src/java-runtime/java-runtime.csproj" (default target) (6) -> (Build target) -> EXEC : Fatal error : Unable to find package java.lang in classpath or bootclasspath [/home/ed/git/xamarin-android/src/java-runtime/java-runtime.csproj]
/home/ed/git/xamarin-android/src/java-runtime/java-runtime.targets(39,3): error MSB3073: The command ""/usr/lib/jvm/java-8-openjdk-amd64/bin/javac" -d obj/Debug/release -bootclasspath "/home/ed/android-toolchain/sdk/platforms/android-29/android.jar":"/home/ed/git/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/java_runtime.jar" @obj/Debug/release.txt" exited with code 3. [/home/ed/git/xamarin-android/src/java-runtime/java-runtime.csproj]

I tried various things and this is just alluding me on what I'm missing or doing wrong. I'm following the instructions on the repo.

Looks like your Java might not be complete? Can you find the error in your log and paste it with more surrounding context (~20-30 lines before the error)? For XA builds you should be using the OpenJDK (Corretto from Amazon) we install in ~/android-toolchain/jdk and you should consider using the SDK+NDK we install in ~/android-toolchain/{sdk,ndk}. And if you pull changes from our master regularly, I'd recommend doing a rebuild from scratch from time to time (that's one of the first things I do every morning when there are updates - I clean my clone with git clean -xdff, reinitialize all the submodules and do a full make prepare all rebuild)

@grendello Aaaah, I had wondered about those :P Awesome! Thanks for the clarification.

Wonder if it may be worth updating that old job's description with links to the new jobs?

I may end up taking a gander at the packaging scripts and build logs then, poor @directhex is always dealing with that stuff!

Thanks again!

@grendello Aaaah, I _had_ wondered about those :P Awesome! Thanks for the clarification.

Wonder if it may be worth updating that old job's description with links to the new jobs?

I may end up taking a gander at the packaging scripts and build logs then, poor @directhex is always dealing with that stuff!

Thanks again!

No problem :) I'm sure Jo will welcome all and any help with the scripts :) Thanks in advance :)

@grendello using what make prepare provides looks to have solved my build problem, now I just need to get rider to detect the xamarin.android sdk lol Thanks for your help

guess I missed a step, it works now :+1:

@grendello I'm currently facing the same issue as @eman1986. Today I cloned the latest branch (v10.0.200.7) but get the described error. "make prepare" executes well, but "make" stucks. The jdk path is correctly set to ~/android-toolchain/jdk/. Any idea?

"/home/ronny/git/xamarin-android/Xamarin.Android.sln" (Standardziel) (1) ->
"/home/ronny/git/xamarin-android/src/java-runtime/java-runtime.csproj" (Standardziel) (2) ->
(Build Ziel) -> 
  EXEC : Fatal error : Unable to find package java.lang in classpath or bootclasspath [/home/ronny/git/xamarin-android/src/java-runtime/java-runtime.csproj]
  /home/ronny/git/xamarin-android/src/java-runtime/java-runtime.targets(39,3): error MSB3073: Der Befehl ""/home/ronny/android-toolchain/jdk/bin/javac"  -d obj/Debug/release -bootclasspath "/home/ronny/android-toolchain/sdk/platforms/android-19/android.jar":"/home/ronny/git/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/java_runtime.jar" @obj/Debug/release.txt" wurde mit dem Code 3 beendet. [/home/ronny/git/xamarin-android/src/java-runtime/java-runtime.csproj]


"/home/ronny/git/xamarin-android/Xamarin.Android.sln" (Standardziel) (1) ->
"/home/ronny/git/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj" (Standardziel) (31) ->
  /home/ronny/git/xamarin-android/src/Xamarin.Android.NUnitLite/Xamarin.Android.NUnitLite.csproj : error MSB4057: Das Ziel "Build" ist im Projekt nicht vorhanden.


"/home/ronny/git/xamarin-android/Xamarin.Android.sln" (Standardziel) (1) ->
"/home/ronny/git/xamarin-android/src/System.EnterpriseServices/System.EnterpriseServices.csproj" (Standardziel) (35) ->
  /home/ronny/git/xamarin-android/src/System.EnterpriseServices/System.EnterpriseServices.csproj : error MSB4057: Das Ziel "Build" ist im Projekt nicht vorhanden.


"/home/ronny/git/xamarin-android/Xamarin.Android.sln" (Standardziel) (1) ->
"/home/ronny/git/xamarin-android/src/OpenTK-1.0/OpenTK.csproj" (Standardziel) (39) ->
  /home/ronny/git/xamarin-android/src/OpenTK-1.0/OpenTK.csproj : error MSB4057: Das Ziel "Build" ist im Projekt nicht vorhanden.

@RonnyBansemer does ~/android-toolchain/jdk/ actually contain valid JDK? Also, do you export JAVA_HOME? And, if yes, does it point to a correct location?

@grendello Yes, it did. I retried it several times using sudo and it worked. Thanks!

Was this page helpful?
0 / 5 - 0 ratings