Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not embedding project reference targets in multiple targets #933

Open
duarteffc opened this issue Aug 13, 2020 · 14 comments
Open

Not embedding project reference targets in multiple targets #933

duarteffc opened this issue Aug 13, 2020 · 14 comments
Labels

Comments

@duarteffc
Copy link

duarteffc commented Aug 13, 2020

I have a project reference to be embedded in my main project, using its targets, but it only gets embedded in one target.

projectReferences:
  MyProject:
    path: Projects/MyProject/MyProject.xcodeproj

Targets:

MyTarget:
  dependencies:
      - target: MyProject/MyProject
        link: true
        embed: true

MyTargetOne:
  dependencies:
      - target: MyProject/MyProject
        link: true
        embed: true

Only one of the targets embeds the dependency.

@MatheusMBispo
Copy link

This is happening with my project too 😕

@officebluesource
Copy link

For me too. The depended targets are embedded only on the alphabetical sorted first target.
I have 4 targets, which are defined by a template. The template define the dependencies. The dependencies are only embedded in the first target.

@mqzkim
Copy link

mqzkim commented May 18, 2021

Could I ask this is intended spec.. or bug? Are there any updates?

@yonaskolb yonaskolb added the bug label May 18, 2021
@yonaskolb
Copy link
Owner

This is not intended behaviour, and should be treated a bug. I haven't had a chance to look into this.
PR's welcome, even if all the PR does is add a test case that demonstrates this.

@mqzkim
Copy link

mqzkim commented Jul 19, 2021

I just made a project which can reproduce this bug 100%.
When I add a file in TargetExample target, Core framework disappeared.

(cf. When I made the application target to top order of targets in project, the bug doesn't occur.
-> ex. If I change the name TargetExample to 000_TargetExample, Core framework doesn't disappear.)

https://github.com/mqzkim/xcodegen-test

Here are project.yml files below.

Core/project.yml

name: Core
options:
  bundleIdPrefix: com.xcodgentest
targets:
  Core:
    sources: Core
    type: framework
    platform: iOS
    deploymentTarget: "11.0"

Target/project.yml

name: Target
options:
  bundleIdPrefix: com.xcodgentest
projectReferences:
  Core:
    path: ../Core/Core.xcodeproj
targets:
  Target:
    sources: Target
    type: framework
    platform: iOS
    deploymentTarget: "11.0"
    dependencies:
      - target: Core/Core
  TargetExample:
    sources: TargetExample
    type: application
    platform: iOS
    deploymentTarget: "12.0"
    dependencies:
      - target: Target
      - target: Core/Core

@mqzkim
Copy link

mqzkim commented Jul 19, 2021

스크린샷 2021-07-19 오후 3 36 02

This is a screenshot from Target.xcodeproj/project.pbxproj file.
Products has two Core.framework files with different hash.
When I removed one of Core.framework file reference and related codes(38C96BECA2E477A652351E8D), the bug not occurred.

@mqzkim
Copy link

mqzkim commented Jul 19, 2021

This is not intended behaviour, and should be treated a bug. I haven't had a chance to look into this.
PR's welcome, even if all the PR does is add a test case that demonstrates this.

@yonaskolb
I just added PR with test case. #1108
Thanks.

@ildar-gilfanov
Copy link

Hi, guys! Could you finish this bug fix? The issue is very annoying 😩

@mthole
Copy link
Contributor

mthole commented Sep 22, 2021

This might be related to #1017 ?

@kbhavyas
Copy link

kbhavyas commented Mar 3, 2022

Hi, I have an xcodeproject and I am migrating it using xcodegen. I too have the same issue that is only one of the targets embeds the dependency. However, if I open the original project and generate the new one. I don't have the problem. Could you please let me know the possible reason and the way to overcome this issue without openening original xcodeproject.

Thanks.

@zencodex
Copy link

zencodex commented Apr 6, 2022

I found a solution:

original code:

MyTarget:
  dependencies:
      - target: MyProject/MyProject
        link: true
        embed: true

MyTargetOne:
  dependencies:
      - target: MyProject/MyProject
        link: true
        embed: true

CHANGE TO:

MyTarget:
  dependencies:
      - framework: MyProject/MyProject
        implicit: true
        link: true
        embed: true

MyTargetOne:
  dependencies:
      - framework: MyProject/MyProject
        implicit: true
        link: true
        embed: true

change target to framework, and add implicit: true work well for me.

zencodex added a commit to uappkit/uapp-ios that referenced this issue Apr 10, 2022
@simonpierreroy
Copy link

I can take an other look at this. I would really love to fix this issue.
Anyone has more information before I start a deep dive on this?
#1108 (comment)

@ajRiverav
Copy link

@zencodex, thank you for sharing. Why do you think your workaround works?

@ajRiverav
Copy link

ajRiverav commented Aug 6, 2023

Also, in case somebody knows -> #1017 (comment)
@yonaskolb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests