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

Xcodegen remove SPM package after generate, and resolving from Xcode adds it again #1460

Open
AhmedMohamedAllam opened this issue Mar 14, 2024 · 6 comments

Comments

@AhmedMohamedAllam
Copy link

Environment

  • xcodegen version: 2.39.1
  • Xcode version: 15.3

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

  • .yml Configuration Snippet for CleverTapGeofence:
    packages:
       CleverTapGeofence:
          url: https://github.com/CleverTap/clevertap-geofence-ios.git
          from: 1.0.4
@AhmedMohamedAllam
Copy link
Author

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

@dungi
Copy link

dungi commented Mar 20, 2024

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

@Woit
Copy link

Woit commented Mar 24, 2024

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
Copy link

wojciech-kulik commented Mar 24, 2024

@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
Copy link

Mathbl commented May 14, 2024

Is the issue still present in Xcode 15.4?

@yonaskolb
Copy link
Owner

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

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

No branches or pull requests

6 participants