18

When trying to test my app on my device iPhone, I get the following error, I think it's something about registering my device.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(3,3): Error MSB6006: "codesign" exited with code 1. (MSB6006) (multifacturacion.iOS)

The strange thing is that this same device in another mac with xamarin if it works and with the same project.

If someone can help me with this, I have several days looking for a solution.

currarpickt
  • 2,290
  • 4
  • 24
  • 39
Jimmy Jouvin Soria
  • 181
  • 1
  • 1
  • 3

8 Answers8

15

This went away for me after I cleaned the solution in Visual Studio.

(yes this is a complete answer, there are no citations, this is just what I did to fix it).

niico
  • 11,206
  • 23
  • 78
  • 161
  • Unfortunately, this is not a complete answer and for many of us it does not resolve the problem. – Jamshaid K. May 31 '21 at 05:52
  • 3
    It's a complete answer for those it works for. It may not work for everybody. – niico Jun 01 '21 at 11:11
  • Thanks for posting this. So easy to forget when you are in the midst of trying to get your program to run. For me, I had just updated the provisioning profile and got the elusive green checkmark using Automatic Provisioning and even got the program to run successfully. I got the bug after I had important an image. Cleaning the solution was just the trick. – Prashant Marathay Oct 12 '21 at 06:19
12

Open the info.plist and check "Automatic Provisioning".

enter image description here

Martin
  • 271
  • 4
  • 9
  • Could you elaborate more on your answer by posting some code and more detailed explanation. – Artem Oct 03 '18 at 19:34
  • This asks me to select a team, but I can't select my "personal team" I can select with XCode. – rabejens Dec 01 '18 at 17:24
  • 2
    @rabejens I know it's much later, but this might be helpful to others: You need to go to VS settings and go to the Xamarin -> Apple Accounts section and add your apple account in there. – Inrego Apr 09 '19 at 08:15
  • 1
    If Automatic Provisioning is already enabled, you can resolve this issue by changing "Team:" to "select a team..", then back to its original setting. This triggers the automatic code signing process again. – Pancake Apr 15 '19 at 16:11
  • Aye aye captian – Anand Jan 01 '20 at 06:00
3

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...

Mephisztoe
  • 3,276
  • 7
  • 34
  • 48
1

remove your certificates from keychains and add again, close Info.plist open and fill de information on bundle singing option, that works for me, remember link your device with you provisioning.

Dave Rincon
  • 308
  • 3
  • 10
  • Remove certificates from where? – Pancake May 27 '19 at 05:08
  • Sorry Utilitis -> KeyChain access – Dave Rincon May 27 '19 at 21:22
  • Also first, check on the mac build machine if you don't see the dialog that tells you that codesign want to sign... Allow always and you'll be fine. If you don't have the dialog go for the "remove certificate from keychains...". – Jonx Jul 19 '19 at 13:05
0

The answer of Mephisztoe worked for me, except that I am working on Windows and you find the scheme-property in the project-settings and not in the plist-file.

Furthermore be sure that you installed fastlane (just open Extras > Options > Xamarin > Apple-Accounts and click on "install fastlane") and added your Apple-ID there.

I also deleted the certificate with the keychain-utility. That's why I had to reenter my password on the mac as I clicked on build on my windows machine.

With these steps done I can finally work again...

0

If the certificate of Apple developer is expired, you can get the error like "codesign", so you need to create a new certificate in Apple Developer site (https://developer.apple.com/account/), then download & install to your computer.

Jagger
  • 2,352
  • 2
  • 13
  • 12
0

I have been struggling with the same issue for several days, the error came only when I tried to publish the app from my Windows VS 2019. It had no further details of why it was behaving like this.

What I changed was:

  • Created New Publishing Profile & Certificates
  • Instead of selecting Release in Configuration as suggested in this Microsoft article, I selected AppStore from the configuration.
  • Tried to recreate the archive and it was completed successfully.

Now when I tried to publish it, I encountered few error messages, I fixed them and submitted the app again. It worked fine.

Jamshaid K.
  • 3,555
  • 1
  • 27
  • 42
0

For me, the issue was that there was a popup asking for a password on the network-attached Mac. I had to VNC into it and enter the password.

For some reason the first time I did this (and chose "always allow"), it failed again with this error, but the second time I ran it succeeded.

You'll want to make sure to have an app-specific password ready if you haven't already generated one. I have no idea why, but it prompts you for one in VS.

BlueRaja - Danny Pflughoeft
  • 84,206
  • 33
  • 197
  • 283