3

I am trying to install my application extension on my iPhone device, but I am getting the following error:

This application or a bundle it contains has the same bundle identifier as 
this application or another bundle that it contains. Bundle identifiers must be unique.

The app container have the bundle id: com.companyName.AppName and the bundle identifier for the app extension is com.companyName.AppName.WidgetApp.

I have tried to sign the extension with the same provisioning, also I have installed a different AppID from the apple developer site and new provisioning profiles for the App Extension and Also tried to set the signing for the extension Widget to Automatic but still the same error and the app cannot be launched on the device.

What should i do in order to install my application extension to the device?

Here are screenshots of my General Tab for both my app and the Extension:

App: enter image description here

Extension: enter image description here

Thank you.

Iphone User
  • 1,930
  • 2
  • 17
  • 26
  • Have you tried com.companyName.AppName_WidgetApp? I suspect the subdomain is being registered as the same. Edit: hm, nope, that should work fine. can you post a screenshot of the "General" tab for both your app and the extension? Redact the TLD if you need to. – brandonscript Oct 01 '14 at 11:59
  • @remus I have uploaded the 2 screenshots. Check it below – Iphone User Oct 01 '14 at 12:30
  • Darn, saw your comment - totally right. It should gracefully fail back. What does it say in the "Info" tab? Is it pulling the ${PRODUCT.ID} variable, or is it hard coded? – brandonscript Oct 01 '14 at 13:05
  • @remus the bundleID in info tab is the following: info.MyCompany.socialM.$(PRODUCT_NAME:rfc1034identifier) – Iphone User Oct 01 '14 at 13:09
  • That's the extension I presume, what about the main target? – brandonscript Oct 01 '14 at 13:10
  • the main target is hard coded – Iphone User Oct 01 '14 at 13:13
  • OK, try changing the main target to `com.MyCompany.${PRODUCT_NAME:rfc1034identifier}` and the extension to `com.MyCompany.AppName.$(PRODUCT_NAME:rfc1034identifier)` – brandonscript Oct 01 '14 at 13:16
  • Tried it now, same error! also it is the same value com.MyCompany.${PRODUCT_NAME:rfc1034identifier} and com.MyCompany.socialM ! so what is the difference between hard coded and $(PRODUCT_NAME:rfc1034identifier) variable? isnt possible to enter any bundle ID for my app and the create the correspondant AppID from the developer account? – Iphone User Oct 01 '14 at 13:23
  • It should be, yeah, but something's wonky here. It really thinks they're the same -- can you try hard coding all of them to see if that helps? – brandonscript Oct 01 '14 at 13:26
  • Same error:( this is driving me crazy all day – Iphone User Oct 01 '14 at 13:41
  • Have you tried a project clean and restarting Xcode? – brandonscript Oct 01 '14 at 13:45
  • Yes, i tried all this before posting. Even i restarted my laptop twice without any success – Iphone User Oct 01 '14 at 13:59
  • I have now changed my product name from socialM to a different name ex:testing and created the new bundle identifier from developer site (info.MyCompany.testing and info.MyCompany.testing.testingWidget) and corresponding provisioning profile. Now i get the following error!!: "This app contains an app extension with an illegal bundle identifier. App extension bundle identifiers must have a prefix consisting of their containing application's bundle identifier followed by a '.'." why am i getting this error and the bundle id is already with this format! i am really desperate now. – Iphone User Oct 01 '14 at 21:32
  • @IphoneUser Do you got any solution ? I am facing same issue. – The iCoder Jan 02 '15 at 14:58
  • @PavanMore sorry for the very late reply. but the problem was solved when i deleted the widget from my project and then created a new one with new bundle id and new provisioning profiles. it is illogical but xcode make people crazy these days :P – Iphone User Feb 12 '15 at 20:14

3 Answers3

4

Executing a clean command worked for me.

This is done through the XCode menu item; Product > Clean or SHIFT + COMMAND + K

UglyBlueCat
  • 439
  • 1
  • 7
  • 22
Claudio Redi
  • 67,454
  • 15
  • 130
  • 155
1

I had this exact problem and it was due to having a duplicated framework included in the build. I had included both a test and non-test version of the same dynamic framework. Once I removed one, the installation proceeded as expected.

I'm sharing this in the hopes that it will help someone else in case they encounter this particularly obscure situation.

Andres Kievsky
  • 3,461
  • 32
  • 25
-1

In Swift :

If you installed pods then you have to change bundle identifier as org.cocoapods.podName in general identity. Make sure deployment target of all pods should be same to the project’s deployment target.