Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android app is not building on Linux - .NET MAUI 9 RC1 #9296

Open
egvijayanand opened this issue Sep 11, 2024 · 5 comments
Open

Android app is not building on Linux - .NET MAUI 9 RC1 #9296

egvijayanand opened this issue Sep 11, 2024 · 5 comments
Assignees
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-attention A xamarin-android contributor needs to review

Comments

@egvijayanand
Copy link

egvijayanand commented Sep 11, 2024

Description

Android app is not building on Linux - .NET MAUI RC1.

Ends up with some weird error message.

Steps to Reproduce

  1. Ensure MAUI Android workload is installed on Linux
  2. Create a new .NET MAUI app on Linux
  3. Build the app targeting the Android platform
  4. Build fails with weird error messages (Refer to the log output for details)

Link to public reproduction project repository

Default template itself is suffice, no authored code

Version with bug

9.0.0-rc.1.24453.9

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

9.0.0-preview.6.24327.7

Affected platforms

Android

Affected platform versions

Android 35.0

Did you find any workaround?

Nope.

Relevant log output

dotnet build -f net9.0-android Command output.

Restore complete (0.5s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  MauiApp9 failed with 1 error(s) (4.5s)
    /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/35.0.0-rc.1.80/tools/Xamarin.Android.EmbeddedResource.targets(39,5): error XARLP7000:
      System.DllNotFoundException: Unable to load shared library 'libZipSharpNative-3-3' or one of its dependencies. In order to help
       diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment
       variable:
      /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.0-rc.1.24431.7/libZipSharpNative-3-3.so: cannot open shared object file: No
      such file or directory
      /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linu
      x/35.0.0-rc.1.80/tools/libZipSharpNative-3-3.so)
      /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.0-rc.1.24431.7/liblibZipSharpNative-3-3.so: cannot open shared object file:
      No such file or directory
      /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/35.0.0-rc.1.80/tools/liblibZipSharpNative-3-3.so: cannot open shared object
       file: No such file or directory
      /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.0-rc.1.24431.7/libZipSharpNative-3-3: cannot open shared object file: No suc
      h file or directory
      /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/35.0.0-rc.1.80/tools/libZipSharpNative-3-3: cannot open shared object file:
       No such file or directory
      /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.0-rc.1.24431.7/liblibZipSharpNative-3-3: cannot open shared object file: No
      such file or directory
      /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/35.0.0-rc.1.80/tools/liblibZipSharpNative-3-3: cannot open shared object fi
      le: No such file or directory

         at Xamarin.Tools.Zip.Native.zip_open(IntPtr path, OpenFlags flags, ErrorCode& errorp)
         at Xamarin.Tools.Zip.Native.zip_open(String path, OpenFlags flags, ErrorCode& errorp) in /Users/runner/work/1/s/LibZipSharp/
      Xamarin.Tools.Zip/Native.cs:line 162
         at Xamarin.Tools.Zip.ZipArchive.Open(String path, OpenFlags flags) in /Users/runner/work/1/s/LibZipSharp/Xamarin.Tools.Zip/Z
      ipArchive.cs:line 187
         at Xamarin.Tools.Zip.ZipArchive.Open(String path, FileMode mode, String defaultExtractionDir, Boolean strictConsistencyCheck
      s, IPlatformOptions options) in /Users/runner/work/1/s/LibZipSharp/Xamarin.Tools.Zip/ZipArchive.cs:line 267
         at Microsoft.Android.Build.Tasks.Files.ReadZipFile(String filename, Boolean strictConsistencyChecks) in /mnt/vss/_work/1/s/x
      amarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/Files.cs:line 335
         at Xamarin.Android.Tasks.MonoAndroidHelper.ReadZipFile(String filename) in /mnt/vss/_work/1/s/xamarin-android/src/Xamarin.An
      droid.Build.Tasks/Utilities/MonoAndroidHelper.cs:line 361
         at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(IDictionary`2 jars, ICollection`1 resolvedResourceDirectories,
       ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments, ICollection`1 proguardConfigFiles) in /mnt/vss/_wo
      rk/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/ResolveLibraryProjectImports.cs:line 396
         at Xamarin.Android.Tasks.ResolveLibraryProjectImports.RunTask() in /mnt/vss/_work/1/s/xamarin-android/src/Xamarin.Android.Bu
      ild.Tasks/Tasks/ResolveLibraryProjectImports.cs:line 95
         at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /mnt/vss/_work/1/s/xamarin-android/external/xamarin-android-tools/
      src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

Build failed with 1 error(s) in 5.7s
Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@egvijayanand
Copy link
Author

It builds successfully on .NET 8. The issue is only with .NET 9.

@egvijayanand egvijayanand changed the title Android app is not building on Linux - .NET MAUI RC1 Android app is not building on Linux - .NET MAUI 9 RC1 Sep 11, 2024
@jfversluis jfversluis transferred this issue from dotnet/maui Sep 11, 2024
@dotnet-policy-service dotnet-policy-service bot added the needs-triage Issues that need to be assigned. label Sep 11, 2024
@jpobst jpobst added Area: App+Library Build Issues when building Library projects or Application projects. and removed needs-triage Issues that need to be assigned. labels Sep 11, 2024
@dellis1972
Copy link
Contributor

can you do a find in /usr/share/dotnet/packs/Microsoft.Android.Sdk.Linux/35.0.0-rc.1.80/tools/ and look for libZipSharpNative ?

If it is there. can you run ldd on it and make sure it has all its dependencies.

@dellis1972 dellis1972 added the need-info Issues that need more information from the author. label Sep 11, 2024
@dellis1972
Copy link
Contributor

ah there it is. /lib/x86_64-linux-gnu/libc.so.6: versionGLIBC_2.33'` your libc is not up to date or does not match.

@egvijayanand
Copy link
Author

ah there it is. /lib/x86_64-linux-gnu/libc.so.6: versionGLIBC_2.33'` your libc is not up to date or does not match.

So what's the resolution? And which one to update?

@dotnet-policy-service dotnet-policy-service bot added need-attention A xamarin-android contributor needs to review and removed need-info Issues that need more information from the author. labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: App+Library Build Issues when building Library projects or Application projects. need-attention A xamarin-android contributor needs to review
Projects
None yet
Development

No branches or pull requests

5 participants