3

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

I used to create a widget extension in my project, after a while i deleted it, today I tried to run my app on my iPhone I got this error.

It works well on simulator. And I try to install on other iPhones it also works well. I guess it is a physical device specific problem. I tried delete and reinstall the app and restart my device it did not work, and i checked again there is no extension target or any file in my project, I am still getting the same error.

lcl
  • 1,045
  • 11
  • 13
  • The error is very clear about the problem. What are your bundle IDs? – Tom Harrington May 29 '15 at 22:07
  • The error is clear but I am confused. Cause as i said, I have completely delete the target and folder for my widget extension, thus I only have one bundle identifier in my app which maps to my provisioning profile. The weird thing is I can install this app on simulator, or other iPhones (We have a lot of test devices which share the same provisioning profile), just for the single one I am previously using I get this error. I can't figure out a way to fix it. – lcl May 31 '15 at 02:21
  • That doesn't make sense. If you have an app and an extension, you have two bundle IDs. See my answer for more. – Tom Harrington May 31 '15 at 20:52
  • Thank you. Again, I have no extension in my app now which means I only have one bundle identifier in whole my project. If it is like you said, I would not issue this question. Your answer make sense to the error message, but not for my question. Thanks again for your answer and I appreciate your help. – lcl Jun 03 '15 at 03:22

2 Answers2

3

I had the same problem. Turns out that you just need to clean the project and the build folder with this shortcut command + option + shift + k

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Pung Worathiti Manosroi
  • 1,432
  • 1
  • 20
  • 23
0

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

Both the app and the app extension have their own bundle IDs. The extension's bundle ID must be the same as the app's ID plus an extension beginning with a ".". In other words, if your app's bundle ID is com.mycompany.myappname, all bundle extensions must be of the form com.mycompany.myappname.myextensionname. You can replace myextensionname with whatever you like, but the extension's ID must be, well, an extension of the app's bundle ID.

You need to look at your app bundle ID and your extension bundle ID and fix them so that they comply with this rule. Deleting and reinstalling, cleaning and rebuilding, etc, will have no effect if the bundle IDs are don't follow the rule. This is why I asked (in a comment) what your bundle IDs are-- because they are the cause of the problem, and changing them is the only way to fix it.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170