Xcode 6 error: "Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier."

Ios8Xcode6Ios App-Extension

Ios8 Problem Overview


I'm trying to build an extension project and Xcode keeps throwing the error in subject.

Xcode log error

Needless to day, the extension's bundle id is prefixed with app's bundle id.

Product Name: ro.chitza.TodayPics.$(TARGET_NAME:rfc1034identifier

Extension bundle id

I've tried cleaning the build folder and rebuilding, no luck. The funny thing is the entire project got built for a few times, but after some code and UI changes it started failing. Even if I create new projects, the same thing happens after about 5-6 builds.

Did anyone else encounter this error? Any hints for a solution or workaround?

Ios8 Solutions


Solution 1 - Ios8

It looks like the bundle ID behavior changed when WatchOS 2 arrived.

Previously I had an extension bundle identifier like this:

com.mycompany.myappname.watchkitextension

Somewhere else on Stackoverflow it was mentioned that the extension bundle identifier should be in this format, but no matter what I tried Xcode kept throwing errors at me.

The only possible solution is changing the extension bundle identifier to:

com.mycompany.myappname.watchkitapp.watchkitextension

I am pretty sure this wasn't the case with an WatchOS 1 app. A problem because of this change is that you can't actually generate an app id for the bundle identifier com.mycompany.myappname.watchkitextension. This isn't necessary, just set all provisioning profiles in the build settings to automatic and don't forget to use the right code signing certificate for you release/ad-hoc/debug schemes.

I actually found out that this approach works because Xcode suggested fixing the problem and this is what it did.

Solution 2 - Ios8

Try a Clean before the Build. This fixed the problem for me (Xcode 6b2).

Solution 3 - Ios8

I made changes like:

Main app bundle id: com.myapp.testapp

and

Extension app bundle id: com.myapp.testapp.myextension

and its works!!!

Solution 4 - Ios8

For xCode v12 I solved that problem with one click:

TARGETS -> Build Phases -> Embed App Extensions

and check: Copy only when installing

enter image description here

Solution 5 - Ios8

I had to manually change the BundleID in the extension's info.plist to what I needed.

I filed a radar : rdar://17487465

Solution 6 - Ios8

Target->General-->Embedded Binaries delete the older and select the new this was how i solved this problem enter image description here

Solution 7 - Ios8

this helped me:

The extension needs to have the parent's bundle ID as its prefix.

For example, if you app is com.ronnathan.myapp, your extension has to be com.ronnathan.myapp.today. You renamed the app target, now go into the extension target and change the name to match.

taken from here

Solution 8 - Ios8

I got the same error, you probably add a extension like Today widget, since the extension is also a binary itself so it has its own plist, and make sure in extension's plist the bundle id is prefixed with app's bundle id. Hope this helps.

Solution 9 - Ios8

In my case, this error occurred when I changed App bundle identifier. I also have WatchKit App in my project.

To fix this, update the WatchKit Extension and WatchKit App bundle Id prefix with the new bundle id of your app. Check info.plist in both targets.

Also update the following -

Update the following with the new Watch App bundle id. WatchKit Extension > Info.plist - NSExtension->NSExtensionAttributes->WKAppBundleIdentifier

Update the following with the new app id. WatchKit App > Info.plist - WKCompanionAppBundleIdentifier

After changing all the values don't forget to Clean product once.

Solution 10 - Ios8

It might have happened that you duplicated your targets to do a clone app. For instance you selected each of your targets and duplicated them. When you cloned your watchkit extension target its target membership could be automatically assigned to the original watch app.

To fix this, you would need to go to yours original "WatchKit extension.appex" file in Project Navigator and unselect Target Membership in File Inspector for your new clone watch app target. You should do the opposite for your duplicated "Watchkit extension-copy.appex" and make sure it has only duplicated "watch app-copy" target selected there.

Solution 11 - Ios8

Make sure your:

Target App A -> Built Settings -> Code Signing -> Release

is the same with:

Target App A (Extension) -> Built Settings -> Code Signing -> Release

Solution 12 - Ios8

Compile error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier

Extension App id should extend a Containing App id

//for example
//Extension App id
com.company

//Containing App id
com.company.extension

Solution 13 - Ios8

I tried most of the solutions given here, but it did not helped me to fix the issue in Xcode 9.4

This SO Answer helped me fix the issue.

What i did is simply

  1. Unchecking the Automatically manage signing for all the targets and the project

  2. In code signing making it iOS Developer for all the targets and the project.

  3. Clean the project, then close the project and open it.

  4. Now Enable the Automatically manage signing for the target and choose the developer account. Then build it.

It fixed me the error. I don't know when Apple will fix these type of issues. It eats lot of hours.

Edit: I am using This answer too, That my target bundle id is com.companyname.projectname and for the extension bundle id com.companyname.projectname.myextension

Solution 14 - Ios8

The problem is likely that you added a folder using "Create folder references" when adding it to your project (like I did). @Jacob's fix didn't work for me :(

enter image description here

I had to delete the folder reference I added to my project, then clean and build, and that fixed it for me.

enter image description here

Solution 15 - Ios8

I was having the same problems. Changing the CFBundleIdentifier for my WatchKit extension to something other than the original value used when I first added the WatchKit extension and re-setting my shared app group entitlement fixed it for me.

Solution 16 - Ios8

I just clean derived folder and it helps me in these situations.

Solution 17 - Ios8

Go to each target > Build Settings > Product Bundle Identifier > (Rename to whatever)

Solution 18 - Ios8

This was Helpful for me:

I was getting:
>Xcode couldn't find any iOS App Development provisioning profiles matching

So I changed the Bundle Identifier name i.e com.example.something to com.example.something1, and then cleaned the build.

Make sure you change all the dependant bundle id as well..njoy!!

Solution 19 - Ios8

Make sure bundle identifier of Extension have prefixed with app bundle identifier. If its same and still giving error, then go to the .plist file of Extension and change their Bundle Identifier.

Solution 20 - Ios8

when we develop watch app then there is 3 target associate with the app. Their target must have the following style of bundle identifier.

  • The target for iPhone: com.company.app
  • The target for iWatch: com.company.app.watch
  • The target for iWatch Extension: com.company.app.watch.extension

In info.plist for watch target, it must have

> WKCompanionAppBundleIdentifier = com.company.app

and in info.plist for watch app extension, it must have

> NSExtension > NSExtensionAttributes > WKAppBundleIdentifier = > com.company.app.watch

Solution 21 - Ios8

The solution is already covered in a lot of answers:

Containing App Bundle Id: com.alphabet.gmail

and

Extension app bundle id: com.alphabet.gmail.notificationServiceExtension

But why should it be prefixed?

Because Apple wants communication between apps to be by the containing app's bundleId and avoid devs having to go around and send messages to the bundleID of the app Extension.

For example, your server must send a field named apns-topic to send a push notification to APNS so the app can download an image. The value of that topic is the bundleID.

But it's not the bundle ID of the service extension. It's the bundleId of the main app itself.

However on the actual physical phone, both the bundleIDs (com.alphabet.gmail.notificationServiceExtension and com.alphabet.gmail exist).

So how does the OS deliver the notification to the app extension and not the main app?

My understanding is that the OS looks for a target that:

  • Has a BundleId that is prefixed with com.alphabet.gmail example: Extension app bundle id: com.alphabet.gmail.notification
  • Has an NSExtensionPointIdentifier set to com.apple.usernotifications.service. You should not touch this value. It's just a pre-defined value by Apple.

enter image description here

Solution 22 - Ios8

It worked for me after deleting Onesignal runner

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionchitzaView Question on Stackoverflow
Solution 1 - Ios8edwardmpView Answer on Stackoverflow
Solution 2 - Ios8JulianView Answer on Stackoverflow
Solution 3 - Ios8Sandip Patel - SMView Answer on Stackoverflow
Solution 4 - Ios8Milovan TomaševićView Answer on Stackoverflow
Solution 5 - Ios8SushiGrass JacobView Answer on Stackoverflow
Solution 6 - Ios8Michael YangView Answer on Stackoverflow
Solution 7 - Ios8dollar2048View Answer on Stackoverflow
Solution 8 - Ios8coolbeetView Answer on Stackoverflow
Solution 9 - Ios8Namit GuptaView Answer on Stackoverflow
Solution 10 - Ios8Tomasz ZabłockiView Answer on Stackoverflow
Solution 11 - Ios8SantanaView Answer on Stackoverflow
Solution 12 - Ios8yoAlex5View Answer on Stackoverflow
Solution 13 - Ios8R. MohanView Answer on Stackoverflow
Solution 14 - Ios8taberView Answer on Stackoverflow
Solution 15 - Ios8Ari BraginskyView Answer on Stackoverflow
Solution 16 - Ios8Alexander KhitevView Answer on Stackoverflow
Solution 17 - Ios8MarinView Answer on Stackoverflow
Solution 18 - Ios8HiteshView Answer on Stackoverflow
Solution 19 - Ios8Manish MahajanView Answer on Stackoverflow
Solution 20 - Ios8Rajan TwanabashuView Answer on Stackoverflow
Solution 21 - Ios8mfaaniView Answer on Stackoverflow
Solution 22 - Ios8Imran KhanView Answer on Stackoverflow