yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
6.88k stars 809 forks source link

How to solve this issue ? #1393

Open Seonny opened 10 months ago

Seonny commented 10 months ago

My directory structure is like this:

ModuleName.xcodeproj
ModuleName-| Cache | Cache.swift
           | Other.swift
           | project.yml

And project.yml is like this:

  sources:
        - path: ../ModuleName

the project.pbxproj is like this:

37A939F6615B5BA91AE2A93A /* ModuleName */ = {
            isa = PBXGroup;
            children = (
                36E07E7F6383BA23F4B8E79C /* Cache */,
                3789EBB3D0FCEAE7EC3CF6EE /* Other.swift */,
...
}

4198CE16A3FB7B27105EF115 = {
            isa = PBXGroup;
            children = (
                36E07E7F6383BA23F4B8E79C /* Cache */,
                5C3044C94C89DDAD031C461E /* ModuleName */,
 ...
}

...
mainGroup = 4198CE16A3FB7B27105EF115;
...

So xcodebuild is saying that "The file reference for "ModuleName/Cache" is a member of multiple groups ("ModuleName" 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."

How can I resolve this ? I tried createIntermediateGroups true but it didn't work.

freddi-kit commented 9 months ago

@yonaskolb do you know why this happens?

yonaskolb commented 8 months ago

I don't sorry, would need to do some debugging. I suspect that sources going out of the directory is causing issues path: ../ModuleName. The behaviour may change depending on where xcodegen itself is run (in or outside the directory that contains the project.yml)