2

I have inherited a legacy Swift 3 app that features a Share Extension. The client would like to roll out both a production and a testing version of the app with each release: the same app but each having a different api url. I've been using this tutorial to create new targets with new bundle ids, but having duplicated the Share Extension target, it is still connected to the original App target, and throws the following error:

Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier.

I can't work out how to disconnect it from the original and connect it to the duplicate (I have changed the Bundle Identifier field on the General panes of the relevant targets btw).

Can someone tell me how please?

Thanks for reading.

ps: the original question and text of this post were different, meaning the comments immediately below may not make much sense.

Joseph Beuys' Mum
  • 2,395
  • 2
  • 24
  • 50
  • I accepted your edits @bhavesh-nayi even though they seemed extremely trivial – Joseph Beuys' Mum Apr 30 '19 at 13:56
  • If my edits is trivial then reject. I don't mine – Bhavesh Nayi Apr 30 '19 at 14:00
  • 1
    Instead of changing the id back and forth, I would set this up differently. Create a target in Xcode for each bundle id and also create branches in my version control system corresponding to each identifier so that I could easily manage code changes between them. – onnoweb Apr 30 '19 at 14:23
  • thanks @onnoweb in the meanwhile I have found a post advocating that (https://www.appcoda.com/using-xcode-targets/) and have moved in that direction, although the problem still persists under the new targets – Joseph Beuys' Mum Apr 30 '19 at 14:51

1 Answers1

4

Like a lot of things, the answer was quite simple. The 'General' pane of a project target has an 'Embedded Binaries' section. In there is a link to the share extension. All one needs to do - in addition to changing the Bundle Identifier - is to remove the original share extension from this section and add the duplicated one instead.

Joseph Beuys' Mum
  • 2,395
  • 2
  • 24
  • 50