Unable to deploy to iOS local device with "Xamarin.iOS does not support running or debugging the previous built version of your project." error.

Jaroslav Žmolík 0 Reputation points
2023-03-16T10:26:08.54+00:00

Hello,

I have trouble deploying any MAUI iOS application to any physical local iOS device (iPhone 12 and iPhone 13) via the "Hot Restart" feature of Visual Studio (so no Xcode version is involved). It ends up with the error message "Xamarin.iOS does not support running or debugging the previous built version of your project. Please ensure your solution builds before running or debugging it.".

Xamarin.Messaging.IDB.Local.DeployAppMessageHandler Error: 0 : An error occurred while trying to deploy the app 'MauiPokus.app'. Details: Could not install the application 'C:\Users\jaros\AppData\Local\Temp\Xamarin\HotRestart\Signing\MauiPokus.app\out\MauiPokus.ipa' on the device xxx’s iPhone. Details: ApplicationVerificationFailed|0xE8008001 - Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.KbDkZL/extracted/Payload/MauiPokus.app : 0xe8008001 (An unknown error has occurred.)
Xamarin.iOS.Windows.WindowsiOSException: Could not install the application 'C:\Users\jaros\AppData\Local\Temp\Xamarin\HotRestart\Signing\MauiPokus.app\out\MauiPokus.ipa' on the device xxx’s iPhone. Details: ApplicationVerificationFailed|0xE8008001 - Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.KbDkZL/extracted/Payload/MauiPokus.app : 0xe8008001 (An unknown error has occurred.)
   at Xamarin.iOS.Windows.Installer.ApplicationSession.InstallApp(String appPath, String appBundleId) in D:\a\_work\1\s\src\Tools\Xamarin.iOS.Windows.Client\Installer\ApplicationSession.cs:line 276
   at Xamarin.iOS.Windows.Installer.ApplicationSession.Deploy(String appRootFolder, String appBundleId, String appName) in D:\a\_work\1\s\src\Tools\Xamarin.iOS.Windows.Client\Installer\ApplicationSession.cs:line 95
   at Xamarin.iOS.Windows.HotRestartClient.Deploy(AppleDevice nativeDevice, String appBundleId, String appBundleName, Boolean& incremental) in D:\a\_work\1\s\src\Tools\Xamarin.iOS.Windows.Client\HotRestartClient.cs:line 250
   at Xamarin.Messaging.IDB.Local.DeployAppMessageHandler.<ExecuteAsync>d__5.MoveNext() in D:\a\_work\1\s\src\Messaging\Xamarin.Messaging.IDB.Local\Handlers\DeployAppMessageHandler.cs:line 41: 03/16/2023 10:01:53Z

It can be my work project or the default MAUI template in Visual Studio, the result is the same.

I tried typical suspects - deleting "bin" and "obj" folders (many times), reinstalling MAUI workload via the Visual Studio installer, re-adding Apple developer account and its certificates, reinstalling whole Visual Studio, following the "Can't locate the .NET MAUI workloads" guide at the https://learn.microsoft.com/en-us/dotnet/maui/troubleshooting?view=net-maui-7.0 page and finally in the last desperate attempt reinstalling Windows itself.

Nothing helped, the message is always the same, even though this same setup (project, local device, apple account) works on my other PC.

Visual Studio info:

Microsoft Visual Studio Community 2022
Version 17.5.2
VisualStudio.17.Release/17.5.2+33502.453
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Community

ASP.NET and Web Tools   17.5.317.37931
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.5.317.37931
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.5.317.37931
Azure Functions and Web Jobs Tools

C# Tools   4.5.0-6.23128.14+651d32d8017cfcc60fcbd67383601fa9a3deb145
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.4.3 (main@2a4517a)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio   17.5.9 (11975e6)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   6.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core)   17.5.2.2312702+323f505b8fab392bd096ccc384321ca7f26f2633
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   17.2.40118.0
Microsoft SQL Server Data Tools

TypeScript Tools   17.0.20105.2003
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.5.0-6.23128.14+651d32d8017cfcc60fcbd67383601fa9a3deb145
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.5.0-beta.23053.5+794b7c259d9646a7eb685dad865aa27da7940a21
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

VSPackage Extension   1.0
VSPackage Visual Studio Extension Detailed Info

Xamarin   17.5.0.173 (d17-5@33e727c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.5.3.46 (remotes/origin/d17-5@e4dd80b2bb)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK   13.2.0.0 (d17-5/797e2e1)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: 6dd9def
    Java.Interop: xamarin/java.interop/main@149d70fe
    SQLite: xamarin/sqlite/3.40.0@fdc1e34
    Xamarin.Android Tools: xamarin/xamarin-android-tools/main@9f02d77

System info:

OS Name:                   Microsoft Windows 11 Home
OS Version:                10.0.22000 N/A Build 22000
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          jaroslav.zmolik@outlook.com
Registered Organization:   N/A
Product ID:                00342-20920-35847-AAOEM
Original Install Date:     3/16/2023, 4:22:45 AM
System Boot Time:          3/15/2023, 10:10:35 PM
System Manufacturer:       ASUSTeK COMPUTER INC.
System Model:              ROG Strix G513RM_G513RM
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: AMD64 Family 25 Model 68 Stepping 1 AuthenticAMD ~3201 Mhz
BIOS Version:              American Megatrends International, LLC. G513RM.327, 2/16/2023
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-gb;English (United Kingdom)
Input Locale:              cs;Czech
Time Zone:                 (UTC+00:00) Dublin, Edinburgh, Lisbon, London
Total Physical Memory:     32,013 MB
Available Physical Memory: 24,420 MB
Virtual Memory: Max Size:  37,133 MB
Virtual Memory: Available: 26,007 MB
Virtual Memory: In Use:    11,126 MB
Page File Location(s):     C:\pagefile.sys
Hotfix(s):                 7 Hotfix(s) Installed.
                           [01]: KB5022505
                           [02]: KB5008295
                           [03]: KB5012170
                           [04]: KB5019448
                           [05]: KB5023698
                           [06]: KB5022925
                           [07]: KB5005703
Network Card(s):           3 NIC(s) Installed.
                           [01]: MediaTek Wi-Fi 6E MT7922 (RZ616) 160MHz Wireless LAN Card
                                 Connection Name: WiFi
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.0.1
                                 IP address(es)
                                 [01]: 192.168.0.192
                                 [02]: fe80::2740:a623:5ac8:e3f3
                                 [03]: 2a02:8308:5080:d00:6520:2ccb:da54:1a24
                                 [04]: 2a02:8308:5080:d00:ef1b:eb68:d55a:12c8
                           [02]: Realtek Gaming 2.5GbE Family Controller
                                 Connection Name: Ethernet
                                 Status:          Media disconnected
                           [03]: Bluetooth Device (Personal Area Network)
                                 Connection Name: Bluetooth Network Connection
                                 Status:          Media disconnected
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes

Any idea, what the problem could be and what else I should try to solve this issue?

Many thanks in advance.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,556 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,812 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jaroslav Žmolík 0 Reputation points
    2023-03-17T19:58:10.5566667+00:00

    Ok, I have been finally able to make it work. I am not sure what actually caused my problem and what solved it, but after endless tries, these are the steps, after which, it finally deployed:

      1. I run "dotnet workload install ios" (still didn't work, but it may be important)
    1. Removed "Apple developer account" and added it once again.
    2. In Apple account's "Company Details" I created a new "iOS Development certificate".
    3. In "iOS Settings" I unchecked "Remote Simulator to Windows" (I don't even have Visual Studio connected to Xcode so this should have literally zero effect, but I just describing what I did in my desperation :D)
    4. And in "Android Settings" I unchecked "Preserve application cache on device between deploys". My project is being built for Android, but I would expect that this option would not affect iOS deployment in any way. Similar to the previous point, I don't know if this actually made any difference, but I made all these steps (except for the first one) at the same time.

    After that, it magically started to work.

    Thank you, Wenyan, for your comment, it ultimately lead me to tinker a little bit more with Apple Account, and that probably solved it :)