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

后端 未结 20 1307
孤独总比滥情好
孤独总比滥情好 2020-12-08 01:45

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

\"Xcode

相关标签:
20条回答
  • 2020-12-08 02:18

    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.

    0 讨论(0)
  • 2020-12-08 02:19

    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

    0 讨论(0)
  • 2020-12-08 02:22

    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.

    0 讨论(0)
  • 2020-12-08 02:23

    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

    0 讨论(0)
  • 2020-12-08 02:24

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

    I filed a radar : rdar://17487465

    0 讨论(0)
  • 2020-12-08 02:24

    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

    0 讨论(0)
提交回复
热议问题