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
21.84k stars 1.67k forks source link

MAUI.iOS /usr/bin/codesign exited with code 2: invalid option #22235

Open Jakar510 opened 2 months ago

Jakar510 commented 2 months ago

Description

After doing the workaround for this issue, I get the following error

C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error :
    /usr/bin/codesign exited with code 2:
    codesign: invalid option --  
    Usage: codesign -s identity [-fv*] [-o flags] [-r reqs] [-i ident] path ... # sign
        codesign -v [-v*] [-R=<req string>|-R <req file path>] path|[+]pid ... # verify
        codesign -d [options] path ... # display contents
        codesign -h pid ... # display hosting paths
        codesign --validate-constraint path ... # check the supplied constraint plist
    Failed to codesign '<project>': codesign: invalid option --  
    Usage: codesign -s identity [-fv*] [-o flags] [-r reqs] [-i ident] path ... # sign
        codesign -v [-v*] [-R=<req string>|-R <req file path>] path|[+]pid ... # verify
        codesign -d [options] path ... # display contents
        codesign -h pid ... # display hosting paths
        codesign --validate-constraint path ... # check the supplied constraint plist

Steps to Reproduce

Create/open MAUI project. try the workaround listed above. Disable Hot Reload (required due to AppCenter known issue) Try to build...boom

Link to public reproduction project repository

No response

Version with bug

8.0.7 SR2

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

iOS 17.x

Did you find any workaround?

Nope

Relevant log output

C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\17.2.8053\tools\msbuild\iOS\Xamarin.Shared.targets(2257,3): error :
        /usr/bin/codesign exited with code 2:
        codesign: invalid option --  
        Usage: codesign -s identity [-fv*] [-o flags] [-r reqs] [-i ident] path ... # sign
            codesign -v [-v*] [-R=<req string>|-R <req file path>] path|[+]pid ... # verify
            codesign -d [options] path ... # display contents
            codesign -h pid ... # display hosting paths
            codesign --validate-constraint path ... # check the supplied constraint plist
        Failed to codesign '<project>': codesign: invalid option --  
        Usage: codesign -s identity [-fv*] [-o flags] [-r reqs] [-i ident] path ... # sign
            codesign -v [-v*] [-R=<req string>|-R <req file path>] path|[+]pid ... # verify
            codesign -d [options] path ... # display contents
            codesign -h pid ... # display hosting paths
            codesign --validate-constraint path ... # check the supplied constraint plist
github-actions[bot] commented 2 months ago

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!

Open similar issues:

Closed similar issues:

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

drasticactions commented 2 months ago

@rolfbjarne Do you know if this and the other issue they referenced MAUI UI issues, issues with SDK tooling, or something else?

rolfbjarne commented 2 months ago

I'm not sure what's going on here.

@Jakar510 can you get a binary build log (https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#binary-build-logs) that shows the build error?

jaosnz-rep commented 2 months ago

I used your demo app(TestMauiAp) and the MAUI project I created myself (8.0.7 and 8.0.21), and I couldn't reproduce this error. It built successfully without errors and warnings.

Jakar510 commented 2 months ago

I updated to Visual Studio v17.10.0 Preview 7 and I get the following error: Verification of iOS environment is running. Please try again in a moment.

I tried restarting the mac, VS and windows. no change.