yonaskolb / XcodeGen

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

Xcode removing Package.resolved #1460

Open AhmedMohamedAllam opened 3 months ago

AhmedMohamedAllam commented 3 months ago

Environment

Description

I've encountered an issue where xcodegen fails to retain the CleverTapGeofence Swift Package Manager (SPM) dependency in the Package.resolved file of the generated Xcode project. The dependency is correctly specified in the .yml configuration file, and when dependencies are resolved directly through Xcode, the CleverTapGeofence package is successfully added. However, upon generating the project with xcodegen, this particular package is missing from Package.resolved.

Steps to Reproduce

  1. Specify CleverTapGeofence package in the .yml configuration file for xcodegen.
  2. Generate the Xcode project using xcodegen.
  3. Observe that the CleverTapGeofence package is missing from Package.resolved in the generated project.

Expected Behavior

The CleverTapGeofence package, as specified in the .yml file, should be retained in the Package.resolved file of the generated project, similar to how it is retained when adding the package directly through Xcode's SPM integration.

Actual Behavior

The CleverTapGeofence package is missing from the Package.resolved file in the generated Xcode project, despite being specified in the .yml configuration file for xcodegen.

Additional Information

AhmedMohamedAllam commented 3 months ago

This issue only happens with Xcode 15.3, after revert back to 15.2 it works as expected.

dungi commented 3 months ago

I have the same issue :) always have to resolve packages manually with 15.3

Woit commented 3 months ago

Also have this issue on xcode 15.3 (thx aapl)

As temporary solution you can add next lines to top of project.yml

options:
  postGenCommand: xcodebuild -resolvePackageDependencies -project MyApp.xcodeproj -scheme MyApp

and replace "MyApp" to yours project name

(@wojciech-kulik FYI)

wojciech-kulik commented 3 months ago

@Woit thanks for the workaround!

I've already reported this issue to Apple: FB13684602

It happens even if you just reset xcodeproj in your external git client :). So it's not connected with XcodeGen. In general, any modification of the project outside of Xcode will cause that.

Mathbl commented 1 month ago

Is the issue still present in Xcode 15.4?

yonaskolb commented 1 month ago

Sadly this still seems to be present in Xcode 15.4 😞 How this issue still hasn't been fixed baffles me

mobile-sergey commented 1 month ago

Is the issue still present in Xcode 15.4?

Unfortunately Apple not fix this bug yet.