yonaskolb / yonaskolb/XcodeGen

Platform settings not applied for new target

Open
#1,178 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
8.8k
Forks
908
Avg merge
17d 14h
Merged PRs (30d)
2

Description

Hi folks, new to Xcodegen. I am trying to add a watchOS app to an existing project. After a lot of setup for the new targets I tried to build and am getting the following errors.

Showing Recent Messages
unable to resolve product type 'com.apple.product-type.watchkit2-extension' for platform 'iphoneos'

unable to resolve product type 'com.apple.product-type.watchkit2-extension' for platform 'iphonesimulator'

unable to resolve product type 'com.apple.product-type.watchkit2-extension' for platform 'iphonesimulator'

Couldn't look up product type 'com.apple.product-type.watchkit2-extension' in domain 'iphonesimulator': Couldn't load spec with identifier 'com.apple.product-type.watchkit2-extension' in domain 'iphonesimulator'

I copied the target files from other targets that were app-extensions in the project. I did build with XcodeGen with the wrong platform and type without thinking to change any of the settings. While trying to debug, a lot of settings for the target file have been removed and I am left with only the necessities, correct type and correct platform. This and the other watch app target are both the exact same besides the name. I have tried changing the platform to tvOS as well and it doesn't change the errors. It refuses to change off of iphoneos in Xcode

name: redacted WatchKit Extension

schemes:
  redacted WatchKit Extension:
    build:
      targets:
        redacted WatchKit Extension:
        - running

targets:
  redacted WatchKit Extension:
    type: watchkit2-extension
    platform: watchOS

    sources:
    - path: .

Thanks for any help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the shown XcodeGen target configuration and reproduce the generated project using the watchOS platform and watchkit2-extension type. Trace how the target's platform setting is carried into the generated Xcode project, then verify that the generated product type resolves for watchOS instead of iPhoneOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift, yaml
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.