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.24k stars 1.76k forks source link

Code Signing fails for iOS #15344

Open gktval opened 1 year ago

gktval commented 1 year ago

Description

I have been stuck for several days trying to codesign the app. A month ago, after working on it for several days, I finally got the app code signed and working on iOS. Then I went back to my Windows machine to develop some more. Now I am bringing it back to the Mac and trying to debug on the iPhone, but I am once again having code sign issues.

In the 'Deploy to Device' output, I the error message is "The executable contains an invalid signature." After trying for a bit, deleting certificates and provision profiles in my Apple Account and re-creating them, removing Apple Accounts from Visual Studio and re-adding it, I remain unsuccessfull.

At the moment, my csproj looks like this:

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
      <ApplicationTitle>MyApp</ApplicationTitle>
      <CreatePackage>false</CreatePackage>
      <ApplicationDisplayVersion>0.0.1</ApplicationDisplayVersion>
      <ApplicationVersion>1</ApplicationVersion>
      <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
      <MtouchDebug>true</MtouchDebug>
      <MtouchLink>None</MtouchLink>
      <CodesignEntitlements>Platforms\iOS\Entitlements.plist</CodesignEntitlements>
      <CodesignProvision>Automatic</CodesignProvision>
      <CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>

I have tried both manual and automatic provisioning. I have also tried adding <EnableCodeSigning>true</EnableCodeSigning>, but that creates another error of 'codesign' exited with code 1.

Can someone please assist it getting the Maui app to once again deploy to the iPhone?

Steps to Reproduce

Create a Maui project and deploy to iPhone.

Link to public reproduction project repository

none

Version with bug

7.0.86

Last version that worked well

7.0.86

Affected platforms

iOS

Affected platform versions

iOS 14+

Did you find any workaround?

No response

Relevant log output

No response

gktval commented 1 year ago

After replacing all the certificates and provisions, the new error is

ApplicationVerificationFailed: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.OnfHF4/extracted/MyApp.app : 0xe800801c (No code signature found.)

Here is the build output if this can help. I have the account and team set in both Visual Studio Accounts and in the Info.plist.

  Done executing task "WriteItemsToFile".
Target "_DetectSigningIdentity" skipped. Previously built successfully.
Target "_CleanAppBundleRootDirectory" skipped, due to false condition; ('$(_PlatformName)' == 'MacCatalyst' Or '$(_PlatformName)' == 'macOS') was evaluated as ('iOS' == 'MacCatalyst' Or 'iOS' == 'macOS').
Target "_EmbedProvisionProfile" skipped, due to false condition; ('$(_ProvisioningProfile)' != '') was evaluated as ('' != '').
Target "_CollectCodesigningData" skipped. Previously built successfully.
Target "_StoreCodesigningData" skipped. Previously built successfully.
Target "_DetectSigningIdentity" skipped. Previously built successfully.
Target "_CleanAppBundleRootDirectory" skipped, due to false condition; ('$(_PlatformName)' == 'MacCatalyst' Or '$(_PlatformName)' == 'macOS') was evaluated as ('iOS' == 'MacCatalyst' Or 'iOS' == 'macOS').
Target "_EmbedProvisionProfile" skipped, due to false condition; ('$(_ProvisioningProfile)' != '') was evaluated as ('' != '').
Target "_CollectCodesigningData" skipped. Previously built successfully.
Target "_StoreCodesigningData" skipped. Previously built successfully.
Target _CodesignAppBundle:
  Using "ComputeCodesignItems" task from assembly "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7060/tools/msbuild/iOS/../iOS/Xamarin.iOS.Tasks.dll".
  Task "ComputeCodesignItems"
  Done executing task "ComputeCodesignItems".
  Using "Codesign" task from assembly "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7060/tools/msbuild/iOS/../iOS/Xamarin.iOS.Tasks.dll".
  Task "Codesign"
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Security.Cryptography.Native.Apple.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Security.Cryptography.Native.Apple.dylib' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-diagnostics_tracing.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-diagnostics_tracing.dylib' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libHarfBuzzSharp.framework/.stampfile' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libHarfBuzzSharp.framework' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.IO.Compression.Native.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.IO.Compression.Native.dylib' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Net.Security.Native.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Net.Security.Native.dylib' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-hot_reload.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-hot_reload.dylib' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libSkiaSharp.framework/.stampfile' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libSkiaSharp.framework' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-debugger.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-debugger.dylib' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libxamarin-dotnet-debug.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libxamarin-dotnet-debug.dylib' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Native.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Native.dylib' needs to be codesigned.
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmonosgen-2.0.dylib' does not exist, so the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmonosgen-2.0.dylib' needs to be codesigned.
    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libSkiaSharp.framework

    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Security.Cryptography.Native.Apple.dylib

    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libHarfBuzzSharp.framework

    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Net.Security.Native.dylib

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Net.Security.Native.dylib: replacing existing signature
    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Net.Security.Native.dylib: signed Mach-O thin (x86_64) [libSystem.Net.Security.Native]

    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Net.Security.Native.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Net.Security.Native.dylib', and it will be created
    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-hot_reload.dylib

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libSkiaSharp.framework: replacing existing signature
    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libSkiaSharp.framework: signed bundle with Mach-O thin (x86_64) [com.microsoft.libSkiaSharp]

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libHarfBuzzSharp.framework: replacing existing signature
    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libHarfBuzzSharp.framework: signed bundle with Mach-O thin (x86_64) [com.microsoft.libHarfBuzzSharp]

    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libSkiaSharp.framework/.stampfile' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libSkiaSharp.framework', and it will be created
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libHarfBuzzSharp.framework/.stampfile' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/Frameworks/libHarfBuzzSharp.framework', and it will be created
    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.IO.Compression.Native.dylib

    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-debugger.dylib

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Security.Cryptography.Native.Apple.dylib: replacing existing signature
    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Security.Cryptography.Native.Apple.dylib: signed Mach-O thin (x86_64) [libSystem.Security.Cryptography.Native.Apple]

    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Security.Cryptography.Native.Apple.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Security.Cryptography.Native.Apple.dylib', and it will be created
    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-diagnostics_tracing.dylib

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-hot_reload.dylib: signed Mach-O thin (x86_64) [libmono-component-hot_reload-55554944018170263aab385b9799016b2d8a2295]

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-debugger.dylib: signed Mach-O thin (x86_64) [libmono-component-debugger-5555494435bd57df67603cdbbd8cbeb875e7af9a]

    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-debugger.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-debugger.dylib', and it will be created
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-hot_reload.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-hot_reload.dylib', and it will be created
    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libxamarin-dotnet-debug.dylib

    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmonosgen-2.0.dylib

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.IO.Compression.Native.dylib: replacing existing signature
    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.IO.Compression.Native.dylib: signed Mach-O thin (x86_64) [libSystem.IO.Compression.Native]

    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.IO.Compression.Native.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.IO.Compression.Native.dylib', and it will be created
    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-diagnostics_tracing.dylib: signed Mach-O thin (x86_64) [libmono-component-diagnostics_tracing-5555494493c68624c459321fb32e7eaedb64ff75]

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libxamarin-dotnet-debug.dylib: signed Mach-O thin (x86_64) [libxamarin-dotnet-debug-555549447ee2abc3a86830198b4481cffa733e1e]

    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libxamarin-dotnet-debug.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libxamarin-dotnet-debug.dylib', and it will be created
    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-diagnostics_tracing.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmono-component-diagnostics_tracing.dylib', and it will be created
    Tool /usr/bin/codesign execution started with arguments: -v --force --timestamp=none --sign - /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Native.dylib

    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmonosgen-2.0.dylib: signed Mach-O thin (x86_64) [libmonosgen-2-55554944e01dc7dd8ff635828890254c22974695]

    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmonosgen-2.0.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libmonosgen-2.0.dylib', and it will be created
    Tool /usr/bin/codesign execution finished (exit code = 0).

    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Native.dylib: replacing existing signature
    /Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Native.dylib: signed Mach-O thin (x86_64) [libSystem.Native]

    The stamp file 'obj/Debug/net7.0-ios/ios-arm64/codesign/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Native.dylib' is not up-to-date for the item '/Users/user/Projects/MobileApp/MyApp/bin/Debug/net7.0-ios/ios-arm64/MyApp.app/libSystem.Native.dylib', and it will be created
  Done executing task "Codesign".
Target "_CodesignVerify" skipped, due to false condition; ('$(_CodesignAppBundleCondition)' == 'true' And '$(_RequireCodeSigning)' == 'true' And '$(DisableCodesignVerification)' != 'true') was evaluated as ('true' == 'true' And 'false' == 'true' And '' != 'true').
Target CoreCodesign:
Target AfterCodesign:
Target Codesign:
Target "CreateIpa" skipped, due to false condition; ('$(_CanArchive)' == 'true' And '$(_PlatformName)' != 'macOS' And '$(_PlatformName)' != 'MacCatalyst') was evaluated as ('false' == 'true' And 'iOS' != 'macOS' And 'iOS' != 'MacCatalyst').
Target "_CreateInstaller" skipped, due to false condition; ('$(CreatePackage)' == 'true' And '$(_CanOutputAppBundle)' == 'true') was evaluated as ('false' == 'true' And 'true' == 'true').
Target "Archive" skipped, due to false condition; ('$(_CanArchive)' == 'true') was evaluated as ('false' == 'true').
Target "_CheckBrowserWorkloadNeededButNotAvailable" skipped, due to false condition; ('$(TargetsNet7)' == 'true' and '$(RuntimeIdentifier)' == 'browser-wasm' and '$(_BrowserWorkloadDisabled7)' != 'true' and '$(WasmNativeWorkload7)' != 'true') was evaluated as ('true' == 'true' and 'iossimulator-x64' == 'browser-wasm' and '' != 'true' and 'true' != 'true').
Target "_ErrorDisabledWorkload" skipped, due to false condition; ('$(BrowserWorkloadDisabled)' == 'true') was evaluated as ('' == 'true').
Target "_ErrorDualWasmThreadProps" skipped, due to false condition; ('$(TargetsNet7)' == 'true' and '$(RuntimeIdentifier)' == 'browser-wasm' and '$(_BrowserWorkloadDisabled7)' != 'true' and '$(WasmEnableThreading)' == 'true' and '$(WasmEnablePerfTrace)' == 'true') was evaluated as ('true' == 'true' and 'iossimulator-x64' == 'browser-wasm' and '' != 'true' and '' == 'true' and '' == 'true').
Target "_CheckForInvalidConfigurationAndPlatform" skipped. Previously built successfully.
Target "_CheckForInvalidConfigurationAndPlatform" skipped. Previously built successfully.
Target "_ValidateRuntimeIdentifier" skipped. Previously built successfully.
Target Build:
Target "_PackAsBuildAfterTarget" skipped, due to false condition; ('$(GeneratePackageOnBuild)' == 'true' AND '$(IsInnerBuild)' != 'true') was evaluated as ('false' == 'true' AND 'true' != 'true').

Done building project "MyApp.csproj".

Build succeeded.
mlancione commented 1 year ago

Any update on this issue? I'm experiencing the same issue.

gktval commented 1 year ago

I gave up for the time being after working on it unsuccessfully for several days. I would love to hear some solutions, though; so that I can work on IOS again.

gktval commented 1 year ago

I was finally able to make this work. Here were my steps. Created an iOS app in visual Studio (NOT MAUI). Added each of my references one by one to see which one was the problem. They all worked. So then I created a Maui project and added all the references. This worked. So then I started comparing the differences between the two Maui apps. Not sure what exactly fixed the problem (because I ran into some ILLinker errors that I also had to get rid of), but it was one of the following solutions:

Delete the csproj.user file Deleted a bunch of "Removed" files in the csproj. Deleted all of my Windows/MacCatalyst/Android configurations in the csproj so that the mimicked the iOS app that was working.

drmolfar commented 1 year ago

I was finally able to make this work. Here were my steps. Created an iOS app in visual Studio (NOT MAUI). Added each of my references one by one to see which one was the problem. They all worked. So then I created a Maui project and added all the references. This worked. So then I started comparing the differences between the two Maui apps. Not sure what exactly fixed the problem (because I ran into some ILLinker errors that I also had to get rid of), but it was one of the following solutions:

Delete the csproj.user file Deleted a bunch of "Removed" files in the csproj. Deleted all of my Windows/MacCatalyst/Android configurations in the csproj so that the mimicked the iOS app that was working.

In my case "Delete the csproj.user file" fixed the problem.

UkeHa commented 1 year ago

For me non of the above helped

UkeHa commented 1 year ago

Following the advice from above. I still run into this error: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.pYUDAq/extracted/Payload/myapp.app/Frameworks/libSkiaSharp.framework : 0xe8008014 (The executable contains an invalid signature.)

hypdeb commented 1 year ago

Same error here. Default template cannot be deployed to a local iOS device.

cdavidyoung commented 1 year ago

I was experiencing the same issue. My .gitignore includes *.user so I do not have csproj.user on the mac side.

In my case I recently upgraded my iPhone 12 to an iPhone 14 so I recreated my provisioning profile following these instructions carefully: https://learn.microsoft.com/en-us/dotnet/maui/ios/deployment/provision?view=net-maui-7.0#create-a-certificate-signing-request.

This is not an easy process and it took several passes to get things right. Finally though I was able to bring up my app on my iPhone 14.

Zhanglirong-Winnie commented 9 months ago

Verified this issue with Visual Studio Enterprise 17.9.0 Preview 3. Not repro this issue on iOS platform. But sometimes we also encounter this problem.

mirceamuresanse commented 9 months ago

I am having the same issues with a Maui app created on the Windows development environment. When I build it on the Mac (M2), it gives me the same issues with Failed to codesign. Creating a new Maui app works fine, this error doesn't occur, and I am able to deploy on my iPad.

TimJanSA commented 7 months ago

Thumbs up to @gktval

The deletion of the .csproj.user file did the trick. Busy porting a Xamarin project to Maui. Could deploy to iOS simulator, but got "Failed to verify code signature" when deploying to iPhone. Spend the better part of two days reading and with luck the mac did not became a mashed-up wall feature. Macbook Air M2 (macOS Sonoma 14.4.1) with iPhone 15 (iOS 17.4.1), Xcode 15.3. I did try 15.2 also. Manual, automatic provisions, followed many an advice on different forums, but at the end just deleting that one file, and everything worked.

Anyone have an explanation why the csproj.user file causes this issue?