dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.2k stars 1.75k forks source link

MAUI ios application build fails with clang error code 137 #25607

Open Abhirasmanu-Trimble opened 1 week ago

Abhirasmanu-Trimble commented 1 week ago

Description

I am unable to publish my application with latest dotnet workload and xcode 16.1. I moved to latest preview version to see if the bug is resolved there, with out much luck. The problem sarted to appear in 8.0.403 also.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

9.0.0-rc.2.24503.2

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

No response

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

(TaskId:514) Tool xcrun execution started with arguments: clang -g -mios-version-min=14.2 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.1.sdk -Xlinker -rpath -Xlinker @executable_path/ -Qunused-arguments -x assembler -D DEBUG -o /Users/xamarinbuild/Library/Caches/Xamarin/mtbs/builds/MAUISsiSample/241166cc9d9f5de6b41fd647e763c7a49c7c3831636823dc1d1b3224325db5ac/obj/Release/net8.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Trimble.Ssi.Core.dll.o -c /Users/xamarinbuild/Library/Caches/Xamarin/mtbs/builds/MAUISsiSample/241166cc9d9f5de6b41fd647e763c7a49c7c3831636823dc1d1b3224325db5ac/obj/Release/net8.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Trimble.Ssi.Core.dll.s (TaskId:514) Tool xcrun execution finished (exit code = 137).

similar-issues-ai[bot] commented 1 week ago

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

Abhirasmanu-Trimble commented 1 week ago

Attached build diagnostic and binary logs. buildlog.zip

jfversluis commented 1 week ago

@dalexsoto @rolfbjarne ?

rolfbjarne commented 1 week ago

This is strange, every invocation of clang crashes.

Does this also happen if you try with a new project created from a template?

Abhirasmanu-Trimble commented 5 days ago

Hello, I was able to reproduce the problem with template project also. I have attached the build log BuildLogs.zip. Build is started using dotnet build command from command line like this: dotnet build /p:IsPublishing=true;ArchiveOnBuild=true iOSApp1.csproj -c:Release -f:net8.0-ios -p:RuntimeIdentifier=ios-arm64 /p:ServerUser=server-user /p:ServerAddress=server-ip-address -bl:build.binlog -fl -flp:logfile=build.log;verbosity=diagnostic

When building the same project from visual studio I get a different error complaining about missing install_name_tool. Attached the build log from vs visual_studio_build_log.zip install_name_tool name is installed and available in path. When I "type install_name_tool" I get "install_name_tool is /usr/bin/install_name_tool" in the OSX terminal.

rolfbjarne commented 2 days ago

@Abhirasmanu-Trimble do you have this file on your Mac:

~/Library/Preferences/Xamarin/Settings.plist

and if you do, can you try deleting it to see if that fixes the problem?

Abhirasmanu-Trimble commented 2 days ago

Hello @rolfbjarne,

I do not have this file on my mac.

rolfbjarne commented 1 day ago

@Abhirasmanu-Trimble can you run the following in a terminal on your Mac, and paste the output here:

xcode-select -p
sudo xcode-select -s /Applications/Xcode.app

and then try again?

Abhirasmanu-Trimble commented 1 day ago

Hi @rolfbjarne, FYI ~ % xcode-select -p (Result)->/Applications/Xcode.app/Contents/Developer

I still get the same clang error in build

rolfbjarne commented 1 day ago

@Abhirasmanu-Trimble does the project build if you build it from the command line on the Mac? If not, can you attach the corresponding binlog?

Abhirasmanu-Trimble commented 12 hours ago

@rolfbjarne , the build does work when directly built form mac command line (ssh also works). I could not create binlog or daignostic log since the the parameters are not recognized. Detailed log is seems to be generated automatically (no idea why). I have attached the default msubild.log here.msbuild.zip This was command I ran from the command line. dotnet publish -r:ios-arm64 /p:BuildIpa=true -c:Release -f:net8.0-ios -fl -flp:loggile=build.log;verbosity=diagnostic -bl:build.binlog

rolfbjarne commented 5 hours ago

@Abhirasmanu-Trimble does it still fail from Windows if you try with a new project from a template?