xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.42k stars 507 forks source link

Show specific error messages related to archiving and signing #8738

Open Happypig375 opened 4 years ago

Happypig375 commented 4 years ago

Steps to Reproduce

  1. Have a revoked/expired certificate and provisioning profile.
  2. Try to archive or sign.
  3. Observe the error message.
Expected Behavior Actual Behavior
“Certificate ‘certname’ has been revoked or expired” “Codesign exited with code 1”
“Provisioning profile ‘profname’ has been revoked or expired” "No iOS signing identities match the specified provisioning profile 'profname'."

The provisioning profile clearly existed on the Mac, and the error should point out that the provisioning profile ‘profname’ might have been revoked or expired.

Environment

Microsoft Visual Studio Community 2019
Version 16.6.1
VisualStudio.16.Release/16.6.1+30128.74
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

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

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

ASA Service Provider   1.0

ASP.NET and Web Tools 2019   16.6.936.3669
ASP.NET and Web Tools 2019

ASP.NET Core Razor Language Services   16.1.0.2020603+b3ac44798c16fff5b95dbcfe62dea84aa9a1bd72
Provides languages services for ASP.NET Core Razor.

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

Azure App Service Tools v3.0.0   16.6.936.3669
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.4.6000.1
Microsoft Azure Data Lake Tools for Visual Studio

Azure Stream Analytics Tools for Visual Studio   2.4.6000.1
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools   3.6.0-4.20251.5+910223b64f108fcf039012e0849befb46ace6e66
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.

Dotfuscator Community Edition   5.42.0.9514-e0e25f754
PreEmptive Protection - Dotfuscator CE

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

Microsoft Azure HDInsight Azure Node   2.4.6000.1
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.4.6000.1
Language service for Hive query

Microsoft Azure Stream Analytics Language Service   2.4.6000.1
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2019 - v2.9.30212.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.1.50+g25aae5a24a.R
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.6.17 (9692114)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   5.6.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

SQL Server Data Tools   16.0.62004.28040
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   16.0.20417.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.6.0-4.20251.5+910223b64f108fcf039012e0849befb46ace6e66
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.9.1.0 for F# 4.7   16.6.0-beta.20217.4+1c969cac25e2d38d71872efe6c8226029e42bb59
Microsoft Visual F# Tools 10.9.1.0 for F# 4.7

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

Visual Studio Container Tools Extensions (Preview)   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

Visual Studio Tools for Unity   4.6.1.0
Visual Studio Tools for Unity

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Foo   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.6.000.1061 (d16-6@8e68aa8)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.6.0.318 (remotes/origin/d16-6@66afc5421)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.6.40 (1f1466f)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   10.3.1.4 (d16-6/3a10de9)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: 165f4b0
    Java.Interop: xamarin/java.interop/d16-6@2cab35c
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.31.1@49232bc
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-6@bfb66f3

Xamarin.iOS and Xamarin.Mac SDK   13.18.2.1 (29c4ea7)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Build Logs

From the "Xamarin" output,

Publishing project 'appname' completed with errors.
Could not create ipa file for distribution of the archive 'appname'
No iOS signing identities match the specified provisioning profile 'profname'.

The error message should also be updated here.

Example Project (If Possible)

N/A

Corresponding Developer Community problem

https://developercommunity.visualstudio.com/content/problem/1062566/show-specific-error-messages-for-xamarinios-archiv.html

whitneyschmidt commented 4 years ago

@Happypig375 Thank you for your feedback!

This is a great suggestion, our error messages could be better.

We've marked this as an enhancement for Xamarin.iOS and Xamarin.Mac in the future. However, this does not necessarily mean we will take actions on it as we still need to discuss its feasibility internally and make sure it is not conflicting with other features.

whitneyschmidt commented 4 years ago

FYI for the future, we can do better but the specificity of our error message is somewhat limited: man codesign -> codesign exits 0 if all operations succeed. This indicates that all codes were signed, or all codes verified properly as requested. If a signing or verification operation fails, the exit code is 1. Exit code 2 indicates invalid arguments or parameters. Exit code 3 indicates that during verification, all path(s) were properly signed but at least one of them failed to satisfy the requirement specified with the -R option.

Happypig375 commented 4 years ago

Normal .NET developers using cross-platform technology should not know about the exit codes of an Apple-only program. Here is an error message that is better: A signing or verification operation has failed. This may indicate that the certificate 'certname' has been revoked or expired. Please check Keychain Access on the connected Mac.