Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] "codesign" exited with code 1 iOS #6813

Closed
Agredo opened this issue Aug 18, 2019 · 28 comments
Closed

[Bug] "codesign" exited with code 1 iOS #6813

Agredo opened this issue Aug 18, 2019 · 28 comments
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS need-info Waiting for more information before the bug can be investigated
Milestone

Comments

@Agredo
Copy link

Agredo commented Aug 18, 2019

Sometimes during deploying, VS2019 stops with error: "codesign" exited with code 1

Steps to Reproduce

  1. Deploy iOS.

Basic Information

This Happens with the newest VS2019 and XF4.1 (Both not beta)

For more Information: https://stackoverflow.com/questions/48575062/xamarin-ios-error-msb6006-codesign-exited-with-code-1

The fix is very annoying:

Thing is, I am having this error regularily.
I am working with a local developer certificate created on my Mac using a free Apple Id, but without a paid Apple Developer Membership. I am using a Windows based devloper workstation and program in Visual Studio 2019 with Xamarin.Forms 4.0. To get local deployment working again, I need to visit the general settings on my iPhone and remove my trusted account from the list of developer apps under device management which basically not only removes the account but also the app from the device.
Then I need to remove all occurances of the corresponding certificate on my Mac within the Keychain Utility and even the mobileprovision file on my harddrive located somewhere beneath my user directory.
Now I have to Start XCode on my Mac, open the project, I am working on and have it automatically "repair" the signing certificate which basically creates a new one and registers it in the Keychain. The moment I run the app from XCode, I need to always allow keychain access and on my iPhone I can see the account appear in the general settings again which I have to manually trust... again.
THEN I can open the corresponding project in my Visual Studio on my Windows Developer Workstation, rebuild and deploy the app and get no errors.
Without being able to say why, it could happen even the next time I try to build and deploy the app, that this error happens again... this is very (!) inconvenient and I didn't find any real solution for it yet...

Jul 3 at 20:32
Mephisztoe (Stackoverflow)

@samhouts samhouts transferred this issue from xamarin/Xamarin.Forms Aug 20, 2019
@rolfbjarne
Copy link
Member

Thank you for your feedback!

For us to investigate this further, could you please provide your full build logs and all your version information.

To get full build logs just set the log verbosity to diagnostic at the following menu location: Tools > Options > Projects and Solutions > Build and Run

You also want to add -v -v -v -v to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting Properties.

The easiest way to get exact version information: "Help menu", "About Microsoft Visual Studio" item.

Then copy/paste the version information (you can use the "Copy Information" button).

We look forward to hearing from you!

@rolfbjarne rolfbjarne added bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS need-info Waiting for more information before the bug can be investigated labels Aug 21, 2019
@rolfbjarne rolfbjarne added this to the Future milestone Aug 21, 2019
@Agredo
Copy link
Author

Agredo commented Sep 20, 2019

Hi thanks for the Help. Here are my logs and data.

xamarin.Logs.zip

##########################################################################

Microsoft Visual Studio Enterprise 2019 (2)
Version 16.2.5
VisualStudio.16.Release/16.2.5+29306.81
Microsoft .NET Framework
Version 4.8.03752

Installierte Version: Enterprise

Architekturdiagramme und Analysetools 00433-90000-08078-AA000
Microsoft-Architekturdiagramme und Analysetools

Visual C++ 2019 00433-90000-08078-AA000
Microsoft Visual C++ 2019

Allgemeine Azure-Tools 1.10
Bietet allgemeine Dienste für die Verwendung durch Azure Mobile Services und Microsoft Azure-Tools.

Application Insights-Tools für Visual Studio-Paket 9.1.00611.1
Application Insights-Tools für Visual Studio

ASP.NET and Web Tools 2019 16.2.292.25104
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019 16.2.292.25104
Weitere Informationen finden Sie unter https://www.asp.net/.

Azure App Service-Tools v3.0.0 16.2.292.25104
Azure App Service-Tools v3.0.0

Azure Functions and Web Jobs Tools 16.2.292.25104
Azure Functions and Web Jobs Tools

C#-Tools 3.2.1-beta4-19408-03+2fc6a04980f800c59e8ede97e6ae294ff47d666e
C#-Komponenten, die in der IDE verwendet werden. Abhängig von Ihrem Projekttyp und den zugehörigen Einstellungen kann eine andere Version des Compilers verwendet werden.

Erweiterung zum Debuggen von Momentaufnahmen 1.0
Detaillierte Informationen zur Visual Studio-Erweiterung zum Debuggen von Momentaufnahmen

Extensibility Message Bus 1.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

GitHub.VisualStudio 2.9.1.7781
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IntelliCode-Erweiterung 1.0
Detaillierte Informationen zur IntelliCode Visual Studio-Erweiterung

Microsoft Azure-Tools 2.9
Microsoft Azure-Tools für Microsoft Visual Studio 0x10 – v2.9.20626.2

Microsoft Continuous Delivery Tools für Visual Studio 0.4
Die Konfiguration von Azure DevOps-Pipelines von der Visual Studio-IDE aus wird vereinfacht.

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

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++-Assistenten 1.0
Microsoft Visual C++-Assistenten

Microsoft Visual Studio-Tools für Container 1.1
Jetzt können Sie Ihre ASP.NET Core-Anwendung in der Zielumgebung entwickeln, ausführen und überprüfen. Drücken Sie F5, um die Anwendung direkt in einem Container mit Debugfunktionen auszuführen, oder STRG+F5 zum Bearbeiten und Aktualisieren Ihrer Anwendung, ohne den Container erneut erstellen zu müssen.

Mono Debugging for Visual Studio 16.2.6 (4cfc7c3)
Support for debugging Mono processes with Visual Studio.

NuGet-Paket-Manager 5.2.0
NuGet-Paket-Manager in Visual Studio. Weitere Informationen zu NuGet finden Sie unter https://docs.nuget.org/.

ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage-Erweiterung 1.0
Detaillierte Informationen zur ResourcePackage-Erweiterung von Visual Studio

ResourcePackage-Erweiterung 1.0
Detaillierte Informationen zur ResourcePackage-Erweiterung von Visual Studio

SQL Server Data Tools 16.0.61906.28070
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Testadapter für Google Test 1.0
Ermöglicht die Verwendung von Visual Studio-Testtools mit Komponententests, die für Google Test geschrieben wurden. Die Nutzungsbedingungen und Drittanbieterhinweise stehen im Installationsverzeichnis der Erweiterung zur Verfügung.

TypeScript-Tools 16.0.10627.2001
TypeScript-Tools für Microsoft Visual Studio

VC-Paket für Microsoft Visual Studio 1.0
VC-Paket für Microsoft Visual Studio

Visual Basic-Tools 3.2.1-beta4-19408-03+2fc6a04980f800c59e8ede97e6ae294ff47d666e
Visual Basic-Komponenten, die in der IDE verwendet werden. Abhängig von Ihrem Projekttyp und den zugehörigen Einstellungen kann eine andere Version des Compilers verwendet werden.

Visual F# Tools 10.4 für F# 4.6 16.2.0-beta.19321.1+a24d94ecf97d0d69d4fbe6b8b10cd1f97737fff4
Microsoft Visual F# Tools 10.4 für f# 4.6

Visual Studio-Tools für CMake 1.0
Visual Studio-Tools für CMake

Visual Studio-Tools für CMake 1.0
Visual Studio-Tools für CMake

Visual Studio-Tools für Container 1.0
Visual Studio-Tools für Container

Visual Studio Code-Debugadapter-Hostpaket 1.0
Interopebene zum Hosten der Visual Studio Code-Adapter in Visual Studio

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

Xamarin 16.2.0.95 (d16-2@37df81894)
Visual Studio-Erweiterung, um Entwicklung für Xamarin.iOS und Xamarin.Android zu ermöglichen.

Xamarin Designer 16.2.0.375 (remotes/origin/d16-2@357d38ef4)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 16.3.117 (59a59e8)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 9.4.1.1 (d16-2/cec9eb4)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: mono/mono@e6f5369c2d2
Java.Interop: xamarin/java.interop/d16-2@d64ada5
LibZipSharp: grendello/LibZipSharp/d16-2@caa0c74
LibZip: nih-at/libzip@b95cf3f
ProGuard: xamarin/proguard@905836d
SQLite: xamarin/sqlite@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-2@6f6c969

Xamarin.iOS and Xamarin.Mac SDK 12.14.0.114 (c669116)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

###########################################################################

Thank you

Agredo

@Agredo Agredo closed this as completed Sep 20, 2019
@Agredo Agredo reopened this Sep 21, 2019
@rolfbjarne
Copy link
Member

Could you also attach the complete build log? It's not saved in the logs directory, you'll have to open the build log tab in the IDE and copy the text.

@mackayn
Copy link

mackayn commented Oct 1, 2019

Seeing this issue too.

I can work round it with the following steps

Get code1 error
Open iOS properties
Select Automatic for provisioning profile
Save csproj file
Select correct profile
Save csproj file
Deploys correctly.

Seen this bug come and go in Visual Studio since the dark days of 2015

Microsoft Visual Studio Enterprise 2019
Version 16.3.1
VisualStudio.16.Release/16.3.1+29324.140
Microsoft .NET Framework
Version 4.8.03761

Installed Version: Enterprise

Visual C++ 2019   00435-60000-00000-AA632
Microsoft Visual C++ 2019

Application Insights Tools for Visual Studio Package   9.1.00913.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019   16.3.283.64955
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.3.283.64955
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.3.283.64955
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   16.3.283.64955
Azure Functions and Web Jobs Tools

C# Tools   3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
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.2.0 (d16-2@8b56e20)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

JetBrains ReSharper Ultimate 2019.2.2   Build 192.0.20190828.114715
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2019 JetBrains, Inc.

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20816.1

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

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

Microsoft Library Manager   2.0.83+gbc8a4b23ec
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.3.7 (9d260c5)
Support for debugging Mono processes with Visual Studio.

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

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Snapshot Debugging Extension   1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.61908.27190
Microsoft SQL Server Data Tools

TypeScript Tools   16.0.10821.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
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 10.4 for F# 4.6   16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.3.0.274 (d16-3@06531f8)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.3.0.230 (remotes/origin/d16-3-xcode11@bbe518670)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.3.565 (27e9746)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   10.0.0.43 (d16-3/8af1ca8)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: mono/mono/2019-06@7af64d1ebe9
    Java.Interop: xamarin/java.interop/d16-3@5836f58
    LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
    LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.27.1@8212a2d
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333


Xamarin.iOS and Xamarin.Mac SDK   13.2.0.42 (5e8a208)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

@dhirensham
Copy link

Same here, I typically get the codesign error after doing a full rebuild. It then goes away after switching from manual to automatic provisioning (or vice versa, depending on which was currently set). So it's not specific to one type of provisioning profile. It seems more related to the profile not being applied correctly during a rebuild, or being overwritten/lost during a later step, but then after changing the setting to trigger VS to re-apply the provisioning profile and doing a build, not rebuild, things then work because whatever was causing it to break during the rebuild step doesn't happen on a normal build.

@VividDigital
Copy link

VividDigital commented Oct 29, 2019

Getting this error and very annoying as the only way I can fix it is by doing a clean between every build. Any update on this? Doing a full build every time to test is no way to work. I've deleted the certs from keychain and re-added, full reboots etc. Nothing helps. Using the latest version of everything except windows which is Windows 7. Trying to deploy to a late 2018 iPad Pro

Also see here same issue

Also for reference here is the output:
/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch @/Users/redacted/Library/Caches/Xamarin/mtbs/builds/redacted/4447dd2a140157a5b0f8358a7c767a5c/obj/iPhone/Debug/response-file.rsp
/usr/bin/codesign --verify -vvvv -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and (certificate leaf[field.1.2.840.113635.100.6.1.2] exists or certificate leaf[field.1.2.840.113635.100.6.1.4] exists)' bin/iPhone/Debug/redacted
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(2045,3): error MSB6006: "codesign" exited with code 1

@rolfbjarne
Copy link
Member

For anybody who can reproduce this: please get a diagnostic build log from both a working and a failing build, and attach both build logs here.

To get diagnostic build logs set the log verbosity to diagnostic at the following menu location: Tools > Options > Projects and Solutions > Build and Run

You also want to add -v -v -v -v to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting Properties.

@VividDigital
Copy link

Here you go
codesign-builds.zip

@rolfbjarne
Copy link
Member

@VividDigital thank you for the build logs!

A fix is in progress: #7332.

@VividDigital
Copy link

Great. Thanks for the quick response.

@VividDigital
Copy link

When can we expect the next update to be pushed out? This bug is really slowing down development

@VividDigital
Copy link

Following up....

@Inrego
Copy link

Inrego commented Nov 7, 2019

Also eagerly awaiting this to be fixed, as it's the biggest annoyance developing for iOS on Windows at the moment.. My build host is very slow, so whenever this happens I spend an hour trying to rebuild with different settings until it suddenly works again.

@mabdollahiasl
Copy link

visual studio 2019 Version: 16.3.9
I have this problem too....

@feanorn777
Copy link

VS 2019 16.3.10. The problem still persists

@VividDigital
Copy link

This is supposed to be fixed in the new preview as seen here: https://developercommunity.visualstudio.com/content/problem/729766/codedesign-exited-with-code-1.html?childToView=842480#comment-842480

It is NOT fixed. How long is this going to take? This bug makes it pretty much impossible to work if your app is sizable at all.

@whitneyschmidt
Copy link
Contributor

whitneyschmidt commented Dec 17, 2019

@VividDigital I'm sorry that you're still encountering this issue.

There's a workaround in the forum post you linked:

We’ve detected this issue is easily reproducible when using copy always for any file, so if any of your files has the Copy to Output Directory property set to Always we recommend you to change it to Copy if newer. This is a workaround but also a recommendation since using copy always might have a negative impact on the build performance.

Please let us know if that works.

@whitneyschmidt
Copy link
Contributor

@VividDigital - The best way to track the progress of the fix is by following the dev community thread: https://developercommunity.visualstudio.com/content/problem/729766/codedesign-exited-with-code-1.html?childToView=842480#comment-842480

Closing this GH issue as there is nothing actionable for the MaciOS team and it is tracked in DevOps.

@alsaidisoft
Copy link

is there any solution for this problem

@whitneyschmidt
Copy link
Contributor

whitneyschmidt commented Jan 9, 2020

@saidalsaidi There is a workaround posted in this comment: #6813 (comment)

You can track progress on a fix here: https://developercommunity.visualstudio.com/content/problem/729766/codedesign-exited-with-code-1.html?childToView=842480#comment-842480

It looks like it has been fixed in Visual Studio 2019 version 16.5 Preview 1.

Could you please try downloading Visual Studio 2019 version 16.5 Preview 1 and let us know whether the issue still occurs?

@cgladue
Copy link

cgladue commented Jan 18, 2020

i was having this issue, downloaded VS 2019 v16.5 Preview 1 and that fixed the problem

@rezamohamed
Copy link

I am on VS 16.5.2 and am seeing this issue now.

@rodvind
Copy link

rodvind commented Apr 22, 2020

downloaded the latest vs and still see this issue

@zerokewl88
Copy link

Also downloaded the RC 16.7 Preview 1.0, and it is itermittent - sometimes this error occurs, or not at all the first build / archive - but the constantly unable to build there afterwoulds, and looking for answers here again. Anyone have any stable luck ? I am building on a older mac mini, and was thinking if upgrading the device to a new 6 core i7 might help things - its painfully slow to build and then have to wait for this to never actually finish a complete build - where as 20 minutes ago on the previous build, it worked fine (still takes ages to compile though)

@elielson-anjos
Copy link

Getting the same error for the 100th time, nothing I do will fix it. I hate the day I have to deal with Apple, unecessary and annoying as *****.

@pietrodicaprio
Copy link

Any progress on this? I can't bundle my app because i MUST clear the solution for every build process and looks like the bundling executes it twice (or at least executes twice the stuff that triggers this error).

@rolfbjarne
Copy link
Member

@pietrodicaprio you're probably running into a different underlying issue than the one originally reported here (because this one has been fixed), so please file a new issue, and please get a diagnostic build log from both a working and a failing build (as described here), and attach both build logs in the new issue.

@chrisgull
Copy link

Just got this issue, running VS 16.11.4. Workaround to shift between automatic and manual provisioning seems to work,

@ghost ghost locked as resolved and limited conversation to collaborators May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS need-info Waiting for more information before the bug can be investigated
Projects
None yet
Development

No branches or pull requests