Emil Adz
Emil Adz

Reputation: 41119

iOS error "Embedded binary is not signed with the same certificate as the parent app"

Those are my first steps in IOS applications development and I'm facing some problem that I can't figure out.

error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.

    Embedded Binary Signing Certificate:    Not Code Signed
    Parent App Signing Certificate:         iPhone Developer: Emil Adz (9QNEF95395)

I can't understand, what is a Embedded Binary Signing Certificate?

I went over the questions with the same error here, but none of them were related to the problem presented here (Not Code Signed).

I tried to revoke my certificate from the Apple Developer Member Center and request another certificate, but the issue persists.

Does some know how it could be fixed?

Upvotes: 102

Views: 97401

Answers (21)

Shahzain ali
Shahzain ali

Reputation: 1725

I was using OneSignal and it was disabled from the user-defined settings.

Go to Extension target -> Build Settings -> User-Defined -> Change these two values to YES

enter image description here

Upvotes: 0

SerkanHocam
SerkanHocam

Reputation: 608

I had same error when updated latest version of xcode (15.0.1).

I solved it removing all "arm64" from "Excluded Architectures" located "Build Settings" tab.

Upvotes: 1

rob mayoff
rob mayoff

Reputation: 385890

I had this problem with a Photo Editing Extension. I eventually discovered that it was due to my unusual project structure.

  • My project includes a local Swift package containing all the source code and resources for the appex (app extension).
  • The appex links the library created by the Swift package.
  • The appex has no source files of its own. The “Compile Sources” build phase has no files, and it has no “Copy Bundle Resources” build phase.

On a clean build, Xcode builds the appex and embeds it in the app successfully.

On an incremental build, even with no changes to any file, Xcode fails during the “Validate MyEx.appex” step.

The problem, it turns out, is that Xcode re-links the appex executable every time it builds, even if nothing has changed. And Xcode does not then sign the new appex executable, except during a clean build.

This means that the appex executable is always unsigned after an incremental build, so it is never signed with the same certificate as the parent app (because the appex isn't signed at all).

My solution was to add an empty file, dummy.swift, to the appex target. That is sufficient to make Xcode only re-link the appex when needed, and to always sign the appex after linking during an incremental build.

Upvotes: 1

G3N
G3N

Reputation: 321

I had the issue when following the SwiftUI documentation about integrating an iOS app with watchOS.

The issue is that the extension is not under the same development team, so it will fail when we try to compile it.

Nothing about architecture and nothing about trust.

SOLUTION: ScreenShot for xcode

  1. Go to the project general file
  2. Check on the extension folder on the sidebar (check the screenshot number 2)
  3. Switch to the Signing & Capabilities tab
  4. Choose your team (need to match the master project's development team)

Upvotes: 7

Liam de Koster-Kjaer
Liam de Koster-Kjaer

Reputation: 103

I have experienced this same issue in a Unity.iPhone project. We embed a target for a Stickers extension that we ship with the app.

The Stickers extension target is the one complaining about the code sign settings not matching the parent apps.

error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's.

        Embedded Binary Signing Certificate:    Software Signing
        Parent App Signing Certificate:     Apple Distribution

This occurred when the Stickers Extension target build settings were set to ARCHS_STANDARD (arm7, arm64), while the parent app was set to arm64.

I fixed this by setting the Extension's ARCHS build property to arm64.

Go figure, I suspect this output catches a bunch of different issues and just doesn't specify any details in the log message.

Upvotes: 0

bbtyou
bbtyou

Reputation: 51

enter image description here

check your Excluded Architectures

Upvotes: 5

Blarz
Blarz

Reputation: 414

XCode 12.5

In my case, I followed Shakeel Ahmed's answer. But I also needed to do this change on the Pod file.enter image description here

You can find more here https://github.com/facebook/react-native/issues/31480#issue-876308920

Upvotes: 0

vivek jain
vivek jain

Reputation: 11

Check your keychain access expire certificate not deleted that's why its showing a error.

Upvotes: 0

toioski
toioski

Reputation: 1164

Assumptions

  • the app I am working is called TestApp (for the sake of privacy)
  • the steps below are tested in Xcode 11.1
  • the scheme I was using to compile is AdHoc
  • the app has the Push Notification capability

Issue

In my case the issue was caused by a discrepancy between the signing of two targets. The issue was between:

  • the TestApp target (i.e. what in the error is referred to as Parent App Signing Certificate)
  • the notificationServiceExtension target (i.e. what in the error is referred to as Embedded Binary Signing Certificate).

targets

Resolution

In my AdHoc scheme, under the TestApp target, I disabled the automatic signing because I wanted to specify the provisioning profile and the certificate.

The steps I followed were:

  1. from Signing & Capabilities -> AdHoc -> Signing (section)
    1. removed the tick from Automatically manage signing under selected
    2. selected the provisioning profile I wanted to use

signing&capabilities

  1. from Build Settings -> Signing (section)
    1. under Code Signing Identity, choose for both AdHoc and Any SDK the certificate I wanted to use
    2. under Code Signing Style -> AdHoc, chose Manual
    3. under Provisioning Profile -> AdHoc, chose the provisioning profile I wanted to use (i.e. the same as step 1.2)

build settings

The error was thrown because I didn't apply the same settings to the notificationServiceExtension target (which was still using the automatic signing and therefore another certificate). As soon as I have repeated the steps above also for this target, the error was gone.

I hope it can helps someone, because this error drove me crazy!

Upvotes: 13

Simon East
Simon East

Reputation: 2606

I was getting this error trying to build a WatchOS app in Xcode 11 - I tried all the various suggestions in this and other SO posts but the thing that finally worked was switching Xcode to use the legacy build system.

Go to: File | Project (or Workspace) Settings | Build System

And select Legacy Build System

Upvotes: 0

Jirson Tavera
Jirson Tavera

Reputation: 1333

Check if you have more targets like oneSignal or other else and check if you have the same team of the main target.

Upvotes: 0

Shakeel Ahmed
Shakeel Ahmed

Reputation: 6021

Swift 5 . Simple way in my case check this screen shot i am done

enter image description here

Upvotes: 156

heyfrank
heyfrank

Reputation: 5647

I got this error while having another compile time error in my code.

My new target has never been built before.

So I thought I'll fix this error first. But it turned out, that fixing the other error enabled Xcode to build the target and fix the other error itself.

Upvotes: 2

Adriana Pineda
Adriana Pineda

Reputation: 9480

I was having this issue when I migrated to Xcode 10 and managed to fix it by updating the architectures in "Build Settings"> "Valid Architectures" for the Watch target to

$(ARCHS_STANDARD)

This thread helped me out a lot: https://forums.developer.apple.com/thread/107563

Upvotes: 9

Lachezar
Lachezar

Reputation: 6703

It seems this issues appears in xcode 10 and the resolution is different from the aforementioned.

I was able to fix (or rather bypass) the error by setting the Build System to Legacy (via File > Workspace Settings)

Another interesting thing to note is that the signing error would not occurr if I was building to an actual device (i.e. before changing the Build System to Legacy). It would only occurr when building using the simulator and only on Xcode 10 beta 3, 4 and 5.

Link to the original thread: https://forums.developer.apple.com/thread/105537

Upvotes: 9

pkamb
pkamb

Reputation: 35012

I got this error after adding a Copy Files Build Phase to the main app Target.

Copy Files
Destination: Absolute Path
Path: /Applications
File: MyApp.app

This worked the first time I ran the app.

On subsequent runs, Xcode began complaining about the certificate mismatch.

Removing the Copy Files build phase fixes the certificate mismatch. I'm still searching for a way to Copy Files without the error.

Same issue links:

Upvotes: 1

Ben Aubin
Ben Aubin

Reputation: 5657

Oddly enough, I had to remove the products folder from my project in order to fix this error. Xcode crashed then, after reopening, worked like a charm!

Upvotes: 9

Aleksandar Vacić
Aleksandar Vacić

Reputation: 4531

This error is also shown when deployment target of your Today extension is newer than the parent app. They must be the same.

I have iOS app set to 10.0 and added Today extension which was automatically set to 11.4 as the latest. This caused the error to appear. Simply changing the Deployment target of the extension target to 10.0 resolved the issue.

Upvotes: 13

Sazzad Hissain Khan
Sazzad Hissain Khan

Reputation: 40236

Sometimes none of the solution on Stackoverflow works. In that case,

Solution

  1. Make sure that there is no red mark/issue in any of the sections of Signing(Debug), Signing(Release) and Enabled capabilities in both of MainApp and EmbeddedApp
  2. Make sure that both certificates and provisioning profiles are installed under login/system keychain.

enter image description here

  1. Make sure that your certificate is never ever set as Always Trust. Access must be kept as Use System Default

enter image description here

Upvotes: 32

Roland Keesom
Roland Keesom

Reputation: 8298

I got this error when the App Groups weren't set up correctly on all my App IDs in the Developer Portal. Therefor the App Groups in the app didn't work correctly and the Binary for the extension or the Watchkit app couldn't be signed.

Upvotes: 4

Arie Litovsky
Arie Litovsky

Reputation: 4993

The embedded binary is referring to a widget that you are deploying alongside with your app.

In your case, you are not signing your widget with any Signing Identity (since your error says "Not Code Signed").

To resolve this, go to your Project file, find your widget's target, and under the Build Setting tab, find the Code Signing Identity value. Choose the same code signing identity that you are using for your main app's target.

You will also need to create and configure a provisioning profile specifically for your widget when you want to release it.

Upvotes: 94

Related Questions