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.07k stars 1.73k forks source link

[iOs - Publish] iOs Publishing fails with codesign execution finished (exit code = 1). #20640

Closed Buyukcaglar closed 8 months ago

Buyukcaglar commented 8 months ago

Description

In MAUI Blazor hybrid application iOs publishing (both using commandline and VS 2022 publish UI) fails with codesign execution finished (exit code = 1).

I have already checked issue 14044 and applied suggestions there, but the problem still presists.

I can confirm that problem is not related to Resources folder, because I removed it altogehter and the relevant csproj entry, and problem still exists.

Publish command output is provided "Relevant log output" section.

Steps to Reproduce

  1. Clone the provided repo
  2. dotnet publish -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="Apple Distribution: DEVELOPER NAME (****)" -p:CodesignProvision="PROVISION NAME" -p:ServerAddress=MAC_IP_ADDR -p:ServerUser=MAC_USER -p:ServerPassword=MAC_PASSWORD -p:_DotNetRootRemoteDirectory=/Users/[USER_HOME_FOLDER]/Library/Caches/Xamarin/XMA/SDKs/dotnet/

Link to public reproduction project repository

https://github.com/Buyukcaglar/UltimateRemote

Version with bug

8.0.6 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

/usr/bin/mdimport bin/Release/net8.0-ios/ios-arm64/ 
  Tool /usr/bin/codesign execution finished (exit code = 1).

  /Users/user936534/Library/Caches/Xamarin/mtbs/builds/UltimateRemote/6d51b991ac06a9bdadfe9b5e5347ca7883f7d41e576d1bbaf5e85793c0b33ab3/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app: code object is not signed at all
  In subcomponent: /Users/user936534/Library/Caches/Xamarin/mtbs/builds/UltimateRemote/6d51b991ac06a9bdadfe9b5e5347ca7883f7d41e576d1bbaf5e85793c0b33ab3/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/System.Security.Cryptography.aotdata.arm64

C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8022\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error : /usr/bin/codesign exited with code 1: [C:\Projects\UltimateRemote\UltimateRemote.csproj::TargetFramework=net8.0-ios]
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8022\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error : /Users/user936534/Library/Caches/Xamarin/mtbs/builds/UltimateRemote/6d51b991ac06a9bdadfe9b5e5347ca7883f7d41e576d1bbaf5e85793c0b33ab3/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app: code object is not signed at all [C:\Projects\UltimateRemote\UltimateRemote.csproj::TargetFramework=net8.0-ios]
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8022\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error : In subcomponent: /Users/user936534/Library/Caches/Xamarin/mtbs/builds/UltimateRemote/6d51b991ac06a9bdadfe9b5e5347ca7883f7d41e576d1bbaf5e85793c0b33ab3/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/System.Security.Cryptography.aotdata.arm64 [C:\Projects\UltimateRemote\UltimateRemote.csproj::TargetFramework=net8.0-ios]
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8022\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error : Failed to codesign '/Users/user936534/Library/Caches/Xamarin/mtbs/builds/UltimateRemote/6d51b991ac06a9bdadfe9b5e5347ca7883f7d41e576d1bbaf5e85793c0b33ab3/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app': /Users/user936534/Library/Caches/Xamarin/mtbs/builds/UltimateRemote/6d51b991ac06a9bdadfe9b5e5347ca7883f7d41e576d1bbaf5e85793c0b33ab3/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app: code object is not signed at all [C:\Projects\UltimateRemote\UltimateRemote.csproj::TargetFramework=net8.0-ios]
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8022\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error : In subcomponent: /Users/user936534/Library/Caches/Xamarin/mtbs/builds/UltimateRemote/6d51b991ac06a9bdadfe9b5e5347ca7883f7d41e576d1bbaf5e85793c0b33ab3/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/System.Security.Cryptography.aotdata.arm64 [C:\Projects\UltimateRemote\UltimateRemote.csproj::TargetFramework=net8.0-ios]
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8022\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error :  [C:\Projects\UltimateRemote\UltimateRemote.csproj::TargetFramework=net8.0-ios]
C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8022\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error :          [C:\Projects\UltimateRemote\UltimateRemote.csproj::TargetFramework=net8.0-ios]
jfversluis commented 8 months ago

@rolfbjarne ?

rolfbjarne commented 8 months ago

I can confirm that problem is not related to Resources folder, because I removed it altogehter and the relevant csproj entry, and problem still exists.

Yet that's still the problem, because there's a Resources folder in the app bundle:

$ find /Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources/AppIcon
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources/AppIcon/appicon.svg

Looks like that's from here:

https://github.com/Buyukcaglar/UltimateRemote/blob/e00308cc21306a0867a4cccbe4879d54438ceba9/UltimateRemote.csproj#L67

Buyukcaglar commented 8 months ago

I can confirm that problem is not related to Resources folder, because I removed it altogehter and the relevant csproj entry, and problem still exists.

Yet that's still the problem, because there's a Resources folder in the app bundle:

$ find /Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources/AppIcon
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources/AppIcon/appicon.svg

Looks like that's from here:

https://github.com/Buyukcaglar/UltimateRemote/blob/e00308cc21306a0867a4cccbe4879d54438ceba9/UltimateRemote.csproj#L67

Ok, as I understand we have to remove appicon etc altogether from cs proj file, if so where do we set app icon for the project? info.plist?

Buyukcaglar commented 8 months ago

I can confirm that problem is not related to Resources folder, because I removed it altogehter and the relevant csproj entry, and problem still exists.

Yet that's still the problem, because there's a Resources folder in the app bundle:

$ find /Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources/AppIcon
/Users/rolf/test/bugs/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/Resources/AppIcon/appicon.svg

Looks like that's from here:

https://github.com/Buyukcaglar/UltimateRemote/blob/e00308cc21306a0867a4cccbe4879d54438ceba9/UltimateRemote.csproj#L67

@rolfbjarne I have removed entire ItemGroup from csproj file and run dotnet publish command but the outcome is still same. Any suggesstions?

Buyukcaglar commented 8 months ago

I have tried to publish directly on a Mac Computer. Publish still ends with ame error;

<> Tool /usr/bin/codesign execution finished (exit code = 1).

/Users/user936534/Projects/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app: code object is not signed at all In subcomponent: /Users/user936534/Projects/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/System.Security.Cryptography.aotdata.arm64

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : /usr/bin/codesign exited with code 1: [/Users/user936534/Projects/UltimateRemote/UltimateRemote.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : /Users/user936534/Projects/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app: code object is not signed at all [/Users/user936534/Projects/UltimateRemote/UltimateRemote.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : In subcomponent: /Users/user936534/Projects/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/System.Security.Cryptography.aotdata.arm64 [/Users/user936534/Projects/UltimateRemote/UltimateRemote.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : Failed to codesign '/Users/user936534/Projects/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app': /Users/user936534/Projects/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app: code object is not signed at all [/Users/user936534/Projects/UltimateRemote/UltimateRemote.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : In subcomponent: /Users/user936534/Projects/UltimateRemote/bin/Release/net8.0-ios/ios-arm64/UltimateRemote.app/System.Security.Cryptography.aotdata.arm64 [/Users/user936534/Projects/UltimateRemote/UltimateRemote.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : [/Users/user936534/Projects/UltimateRemote/UltimateRemote.csproj::TargetFramework=net8.0-ios] /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8022/tools/msbuild/iOS/Xamarin.Shared.targets(2257,3): error : [/Users/user936534/Projects/UltimateRemote/UltimateRemote.csproj::TargetFramework=net8.0-ios] The application was terminated by a signal: SIGHUP <>

Buyukcaglar commented 8 months ago

I've managed to publish app, by removing all references to resources folder from csproj completely, so we can cloase this issue.