Closed evertefeuille closed 1 year ago
@evertefeuille If you build a .NET Android app in release mode without the MAUI UI, does it fail in the same way?
Try creating a new .NET Android app from CLI:
dotnet workload install android
dotnet new android
Does it fail in the same way?
Hi @evertefeuille. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@drasticactions same error
Rebuild started... 1>------ Rebuild All started: Project: android, Configuration: Release Any CPU ------ Restored C:\Donnees\divers\android\android.csproj (in 7 ms). 1>android -> C:\Donnees\divers\android\bin\Release\net7.0-android\android.dll 1>Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink 1>Optimizing assemblies for size. This process might take a while. 1>Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink 1>Optimizing assemblies for size. This process might take a while. 1>Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink 1>Optimizing assemblies for size. This process might take a while. 1>Optimizing assemblies for size may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink 1>Optimizing assemblies for size. This process might take a while. 1>[1/8] System.Runtime.dll -> System.Runtime.dll.so 1>[2/8] System.Console.dll -> System.Console.dll.so 1>[3/8] System.Runtime.InteropServices.dll -> System.Runtime.InteropServices.dll.so 1>[4/8] System.Linq.dll -> System.Linq.dll.so 1>[5/8] android.dll -> android.dll.so 1>[6/8] Mono.Android.dll -> Mono.Android.dll.so 1>[7/8] Java.Interop.dll -> Java.Interop.dll.so 1>[1/8] android.dll -> android.dll.so 1>[1/8] android.dll -> android.dll.so 1>[1/8] android.dll -> android.dll.so 1>[2/8] System.Console.dll -> System.Console.dll.so 1>[2/8] System.Console.dll -> System.Console.dll.so 1>[2/8] System.Console.dll -> System.Console.dll.so 1>[3/8] System.Linq.dll -> System.Linq.dll.so 1>[3/8] System.Linq.dll -> System.Linq.dll.so 1>[8/8] System.Private.CoreLib.dll -> System.Private.CoreLib.dll.so 1>[3/8] System.Linq.dll -> System.Linq.dll.so 1>[4/8] System.Runtime.InteropServices.dll -> System.Runtime.InteropServices.dll.so 1>[4/8] System.Runtime.InteropServices.dll -> System.Runtime.InteropServices.dll.so 1>[4/8] System.Runtime.InteropServices.dll -> System.Runtime.InteropServices.dll.so 1>[5/8] System.Runtime.dll -> System.Runtime.dll.so 1>[5/8] System.Runtime.dll -> System.Runtime.dll.so 1>[5/8] System.Runtime.dll -> System.Runtime.dll.so 1>[6/8] Java.Interop.dll -> Java.Interop.dll.so 1>[6/8] Java.Interop.dll -> Java.Interop.dll.so 1>[6/8] Java.Interop.dll -> Java.Interop.dll.so 1>[7/8] Mono.Android.dll -> Mono.Android.dll.so 1>[7/8] Mono.Android.dll -> Mono.Android.dll.so 1>[7/8] Mono.Android.dll -> Mono.Android.dll.so 1>[System.Private.CoreLib.dll] Exec (with response file contents expanded) in C:\DONNEES\DIVERS\ANDROID: MONO_PATH=C:\Donnees\divers\android\obj\Release\net7.0-android\android-arm64\linked; MONO_ENV_OPTIONS= C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm64\7.0.9\Sdk..\tools\mono-aot-cross.exe --debug --nollvm "--aot=asmwriter,temp-path=obj\Release\net7.0-android\android-arm64\aot\arm64-v8a\System.Private.CoreLib,profile-only,profile=C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\targets\dotnet.aotprofile,mtriple=aarch64-linux-android,tool-prefix=C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\tools\binutils\bin\aarch64-linux-android-,outfile=obj\Release\net7.0-android\android-arm64\aot\System.Private.CoreLib.dll.so,ld-name=ld,ld-flags=--no-relax -s" "obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll" 1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\targets\Microsoft.Android.Sdk.Aot.targets(91,5): error : Precompiling failed for C:\Donnees\divers\android\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll with exit code 1. 1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.46\targets\Microsoft.Android.Sdk.Aot.targets(91,5): error : Error: Loaded assembly 'C:\Donnees\divers\android\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll' doesn't match original file name 'C:\DONNEES\DIVERS\ANDROID\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll'. Set MONO_PATH to the assembly's location. 1>Done building project "android.csproj" -- FAILED. 1>[8/8] System.Private.CoreLib.dll -> System.Private.CoreLib.dll.so 1>[8/8] System.Private.CoreLib.dll -> System.Private.CoreLib.dll.so ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== ========== Rebuild started at 8:09 AM and took 23.570 seconds ==========
@evertefeuille Thank you!
This isn't an issue that can be fixed in this repo. This repo is for the MAUI UI project, and from the looks of it, your issue is particular to compiling .NET Android apps.
@jonathanpeppers Do you think this should be moved somewhere else? Do you know what this issue is?
This looks like the <MonoAOTCompiler/>
failing, but it fails on a BCL assembly?
C:\DONNEES\DIVERS\ANDROID\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll
The path looks OK (there are some known issues for certain characters in the path), so we can move this to dotnet/runtime.
@evertefeuille can you share a .binlog
file of this error? https://aka.ms/binlog
@jonathanpeppers The logs logs.zip
It's complaining about the casing?
Precompiling failed for C:\Donnees\divers\android\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll with exit code 1.
Error: Loaded assembly 'C:\Donnees\divers\android\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll' doesn't match original file name 'C:\DONNEES\DIVERS\ANDROID\obj\Release\net7.0-android\android-arm64\linked\System.Private.CoreLib.dll'. Set MONO_PATH to the assembly's location.
I'm looking at CentralNode_devenv_PID=9928_x64_BuildManager_Default.binlog
.
/cc @steveisok
@vargaz should this hold true even when aot compiling on windows?
Guess not, that check fail with casing.
@vargaz, use g_strcasecmp
in the HOST_WIN32
case?
I am running into this issue as well. It looks like the issue has been identified and fixed, my question is how do we get this fix? Do we need to wait for next release of Visual Studio? Is there a NuGet package?
I am running into this issue as well. It looks like the issue has been identified and fixed, my question is how do we get this fix? Do we need to wait for next release of Visual Studio? Is there a NuGet package?
The fix to this will be in .NET 8 RC1 and in .NET 7 as part of the September servicing release.
Description
Error when I compile in release mode a new or existing maui project for Android.
https://github.com/dotnet/maui/assets/22406408/e2177da3-62a5-43a0-97f6-eb9da9b62889
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
Installed Workload Id Manifest Version Installation Source
maui-ios 7.0.86/7.0.100 VS 17.6.33829.357
maccatalyst 16.4.7067/7.0.100 VS 17.6.33829.357
maui-android 7.0.86/7.0.100 VS 17.6.33829.357
ios 16.4.7067/7.0.100 VS 17.6.33829.357
maui-windows 7.0.86/7.0.100 VS 17.6.33829.357
maui-maccatalyst 7.0.86/7.0.100 VS 17.6.33829.357
android 33.0.46/7.0.100 VS 17.6.33829.357
wasm-tools 7.0.9/7.0.100 VS 17.6.33829.357
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 10 and up
Did you find any workaround?
No
Relevant log output