iOS code signing error

Hi,

I have been trying to submit my IPA build to the App Store, but keep getting the error message: Error ITMS-90179 Payload … must be signed with the certificate that is contained in the provisioning profile." (Please see the attached image). I don’t know what I am doing wrong. I have tried different ways. I will appreciate your help here.

By the way, it looks that the instruction for Mac version is out of date. It will be nice to have it updated.

Regards,
Bayar

Is this your first iOS build? Signing issues are often related to Fastlane not being installed correctly. Try reinstalling that.

We will look at the documentation. Can you be more specific?

Hi,

Thank you very much for your reply. It’s not my first build, however, it is a first build using a new Mac computer. I will try reinstalling Fastlane. I get this message when uploading the build via Application Loader.

I get really confused when it comes to Apple certificates and provisioning profiles because there are many types. I will REALLY appreciate some more explanation in the Instruction for Mac (Testflight, etc.)

Bayar

Hi,

I just reinstalled the Fastlane, but got the same error message. Any help or suggestions are appreciated.

Bayar

I recently encountered this same error when building mine, and it was definitely related to fastlane not being properly installed/setup. When I did the “automatic” install following the instructions, it didn’t get setup properly the first time if I’m remembering correctly. The key to your error message is that it has the string “TemplateApp” in your code signing, which is the default payload when you install SAB.

I’m sorry I don’t remember more specifics.

Hi,
How do I really know that the Fastlane is properly installed? After following #2 under 4.3 in the Instruction, I got a message something along the line of ‘script is on the path.’ I assumed it is telling me that is installed properly. Am I correct to assume so?

Bayar

Hello @Bayar_Garam,

You should be able to know from the build log, which is a files next to the generated .ipa file in the Ipa Output folder with the basename of your .ipa file with output.log at the end. You can send me the log and I can take a look.

Chris Hubbard

Dear Chris,

Thank you very much for your help. Here I copied the whole file, since I can’t attach a file.

*** SCRIPTURE APP BUILDER ***
*** 5.4 ***

*** Building iOS app ***

App Project: Bible MSV
App Name: Bible MSV
App Version: 3.0
App Build: 11
Package: bible.msv.mongolian
Ipa Filename: bible.mubs.msv.khk-3.0.ipa
Analytics: Yes
Expiry: 2020-06-30
App Builder: /Applications/Scripture App Builder.app/Contents/Java
Audio: None

*** Build iOS Simulator app ***

/* com.apple.actool.compilation-results */
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon20x20@2x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon20x20@3x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon29x29.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon29x29@2x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon29x29@3x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon40x40@2x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon40x40@3x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon60x60@2x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon60x60@3x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon20x20~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon20x20@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon29x29~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon29x29@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon40x40~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon40x40@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon76x76~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon76x76@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/AppIcon83.5x83.5@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/Assets.car
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/simulator/TemplateApp.app/appicon.plist

Copying sim to output folder

/Users/Bayarjargal/App Builder/Scripture Apps/Sim Output/bible.mubs.msv.khk-3.0.app

*** Resigning iOS app ***

/* com.apple.actool.compilation-results */
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon20x20@2x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon20x20@3x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon29x29.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon29x29@2x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon29x29@3x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon40x40@2x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon40x40@3x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon60x60@2x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon60x60@3x.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon20x20~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon20x20@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon29x29~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon29x29@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon40x40~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon40x40@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon76x76~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon76x76@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/AppIcon83.5x83.5@2x~ipad.png
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/Assets.car
/var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/extract/Payload/TemplateApp.app/appicon.plist

Resigning the app
e[35m/Users/Bayarjargal/.fastlane/bin/bundle/lib/ruby/gems/2.2.0/gems/fastlane-2.125.2/sigh/lib/assets/resign.sh /var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App\ Builder/build/SAB.001/i/ios/output/bible.mubs.msv.khk-3.0.ipa 931AC2090BCC8186D58099DCBC12B076647EA404 -p /Users/Bayarjargal/Downloads/Bible_MSV_3_Sep_2018-2.mobileprovision /var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App\ Builder/build/SAB.001/i/ios/output/bible.mubs.msv.khk-3.0.ipae[0m

[03:07:35]: e[32mSuccessfully signed /var/folders/9m/q2v8704551l66wjkvnds5vlr0000gn/T/App Builder/build/SAB.001/i/ios/output/bible.mubs.msv.khk-3.0.ipa!e[0m
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftAVFoundation.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftCore.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftCoreAudio.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftCoreFoundation.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftCoreGraphics.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftCoreImage.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftCoreMedia.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftDarwin.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftDispatch.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftFoundation.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftMetal.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftObjectiveC.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftQuartzCore.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftUIKit.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftos.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app/Frameworks/libswiftsimd.dylib: replacing existing signature
_floatsignTemp/Payload/bible.mubs.msv.khk-3.0.app: replacing existing signature
Resigned the app

Copying ipa to output folder

Copying iOS App Icon File

Signed release IPA built successfully.

-rw-r–r-- 1 Bayarjargal staff 93160876 Jun 18 03:07 /Users/Bayarjargal/App Builder/Scripture Apps/Ipa Output/bible.mubs.msv.khk-3.0.ipa

Copying log to output folder

@Bayar_Garam,

For your information, it is good to use the “@ username” so that notifications are sent.

I don’t see anything wrong in the logs with fastlane installation.
Are you signing with an iOS Distribution (App Store and Ad Hoc) certificate?
Are you using an App Store Distribution Provisioning Profile?

Thanks,
Chris

@ChrisHubbard,

Thank you very much for taking your time to look into this.
Yes, I am using an iOS Distribution certificate *App Store and Ad Hoc) and an App Store Distribution profile.

Any other avenue for resolution?

Bayar

@Bayar_Garam,
You mentioned you are using a new Mac computer to build the app. Have you installed the Apple certificates correctly on your new Mac?

Was your Apple certificate recently renewed?

Aaron

@Aaronsedna,

Yes, my membership was expiring and I renewed it for another year. How do I know if I correctly installed my Apple certificate correctly on my Mac? Here are images from my Apple account and from Keychain. This is where I am not sure. I feel confused about all these different certificates and terminologies. Thank you very much for your help.

Bayar


@Bayar_Garam,
Login to your Apple Developer account: https://developer.apple.com and click on Certificates, Identifiers and Profiles then click on the Profiles section located on the left hand side of the page. You will see all the provisioning profiles listed here. If any of those are expired, the status will be indicated in red like in the screenshot below.


Click on the expired provisioning profile of your app.
Under Certificates section use the radio button to select your latest certificate and click Save

This will present you with a Download button.

Download the latest provisioning profile for your app. Replace the old one with the newly downloaded provisioning profile on your Mac.
Rebuild the app.

Also double check whether you are using the correct signing identity (only applicable if you have multiple singing identity)

Hope this helps :slight_smile:
Aaron

@Aaronsedna,

None of my certificates are expired. The same for the provisioning profiles.

Bayar

@Bayar_Garam
Can you add a screenshot of the Signing (iOS) section in SAB?
What is the signing identity you are using to sign the app? From the screenshot you sent it looks like you have got 3 iPhone Distribution certificates and various other certificates.

Aaron

@Aaronsedna,

Here it is.

Thanks.

Developer ID Application is not the correct type. It should be one of the iPhone Distribution certificates. Also, the provisioning profile has to be associated with the correct iPhone Distribution certificate (based on the date).

@ChrisHubbard, @Aaronsedna

I have deleted and re-created my certificate and provisioning profile. I still got error messages. Please see below.

@Aaronsedna, @ChrisHubbard

In the first image I posted above, what is 'The identifier “sil.org.TemplateApp” in your code signature for “TemplateApp” must match its Bundle identifier “bible.msv.mongolian”?

Is it an indication of something in the program that needs to be changed (sil.org.TemplateApp)? I might be wrong here.

I have been trying so many times in different ways that I am getting nowhere.

Thanks for your help.
Bayar

We worked through getting it work again. Here are some things that we did:

  • Make sure the certificate is an iPhone Distribution signing identity. [Note: I am making a change to only show iPhone – I thought I already did this.]
  • If there are multiple signing identities with the same display name (it easily happens), make sure we know which one is being using (by looking at the expiration date). [Note: I am making a change to show the expiration date when switching signing identities.]
  • Make sure the provisioning profile was created using the signing identity (matching expiration dates).
  • Make sure the provisioning profile is for App Store distribution.

Even once we got all of that sorted, there was another issue on his computer that was causing the signing to fail: errSecInternalComponent. I had to Google for that one. It seems like a not very common error. There was some problem with the system accessing the key to sign with. We followed the suggestion at https://stackoverflow.com/a/51069480/35577.

Solved!

Thanks,
Chris