Skip to content

"file reference member of multiple groups" warning in Xcode 10 #405

Open

Description

@LinusU

After upgrading to Xcode 10, I'm getting the following warning when building my project:

2018-09-19 13:29:32.267 xcodebuild[17317:5682171] warning:  The file reference for "Sources/Components" is a member of multiple groups ("Sources" and ""); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
2018-09-19 13:29:32.267 xcodebuild[17317:5682171] warning:  The file reference for "Sources/Coordinators" is a member of multiple groups ("Sources" and ""); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
2018-09-19 13:29:32.267 xcodebuild[17317:5682171] warning:  The file reference for "Sources/Extensions" is a member of multiple groups ("Sources" and ""); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
2018-09-19 13:29:32.287 xcodebuild[17317:5682171] warning:  The file reference for "Sources/Pages" is a member of multiple groups ("Sources" and ""); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.
2018-09-19 13:29:32.287 xcodebuild[17317:5682171] warning:  The file reference for "Sources/Stores" is a member of multiple groups ("Sources" and ""); this indicates a malformed project.  Only the membership in one of the groups will be preserved (but membership in targets will be unaffected).  If you want a reference to the same file in more than one group, please add another reference to the same path.

My directory structure looks like this:

Sources/
  Components/
    *.swift
  Coordinators/
    *.swift
  Extensions/
    *.swift
  Pages/
    *.swift
  Stores/
    *.swift
  *.swift
project.yml

Activity

  1. yonaskolb commented on Sep 29, 2018

    @yonaskolb
    Owner

    Hi @LinusU. Was your version of XcodeGen compiled with Swift 4.2?

  2. LinusU commented on Sep 29, 2018

    @LinusU
    ContributorAuthor

    I'm getting the warning both on a version compiled with an older version (I guess Swift 4.1, XcodeGen version 1.7.0), and with the newer version 1.11.2 compiled with Swift 4.2.

  3. yonaskolb commented on Sep 29, 2018

    @yonaskolb
    Owner

    Could you share some more details of your spec? Do multiple targets use the same source paths?
    Better yet if you could submit a PR to the TestProject fixture that highlighted the issue, even better 😄👍

  4. LinusU commented on Oct 2, 2018

    @LinusU
    ContributorAuthor

    Sorry for the lack of detail ☺️

    I have multiple targets that use the same paths, it looks something like this (very simplified):

    name: Ctrlpanel
    options:
      bundleIdPrefix: com.ctrlaltdeseat
    targets:
      Ctrlpanel:
        type: application
        platform: iOS
        deploymentTarget: "12.0"
        sources:
          - path: Sources
            excludes:
              - AppInfo.plist
              - Coordinators/FindLogin.swift
              - CredentialProvider.swift
              - CredentialProviderInfo.plist
        settings:
          INFOPLIST_FILE: Sources/AppInfo.plist
        dependencies:
          - target: CredentialProvider
      CredentialProvider:
        type: app-extension
        platform: iOS
        deploymentTarget: "12.0"
        sources:
          - path: Sources/Assets.xcassets
          - path: Sources/Constants.swift
          - path: Sources/Coordinators/FindLogin.swift
          - path: Sources/CredentialProvider.swift
          - path: Sources/LaunchScreen.storyboard
          - path: Sources/Pages/AccountList.swift
          - path: Sources/Pages/Unlock.swift
          - path: Sources/Settings.swift
          - path: Sources/Stores/Auth.swift
        settings:
          INFOPLIST_FILE: Sources/CredentialProviderInfo.plist

    I'll try and submit a PR as soon as I get some time 👍

  5. yonaskolb commented on Dec 5, 2018

    @yonaskolb
    Owner

    @LinusU is this still an issue for you?

  6. LinusU commented on Dec 5, 2018

    @LinusU
    ContributorAuthor

    Yes, sorry for not providing more info 😓

    Still an issue in 2.0.0

  7. LinusU commented on Dec 5, 2018

    @LinusU
    ContributorAuthor

    Hmm, I tried to reproduce it here, but haven't been able to yet 🤔

    master...LinusU:warning-test-case

  8. LinusU commented on Dec 5, 2018

    @LinusU
    ContributorAuthor

    Really went down the rabbit hole on this one. The bug is only triggered with certain app names 😂

    e.g. Ctrlpanel and Ctrlalala triggers the behaviour, but AppWithExtension and BiBaBo doesn't 😮

    edit: DishWasher triggers the bug, but AishWasher doesn't, seems to have something to do with lexicographical ordering 🤔

    edit2: Credentiaq triggers the bug, but Crendetiaa doesn't 😂

  9. LinusU commented on Dec 5, 2018

    @LinusU
    ContributorAuthor

    @yonaskolb okay, I've added a test case here: master...LinusU:warning-test-case

    I did the following to see it:

    cd Tests/Fixtures/TestProject
    mint run yonaskolb/xcodegen
    xcodebuild -project Project.xcodeproj -target Zapp -quiet CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO

    The first line of the output is the warning

  10. grigorye commented on Feb 20, 2020

    @grigorye

    I was able to workaround this by adding createIntermediateGroups: true option to the (root) options section of .yml.

  11. xxi511 commented on Sep 2, 2022

    @xxi511

    Just have this issue.
    In my case, it is caused by typo.
    e.g. some place is Sources/Components and some place is Sources/components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions