CocoaPods / Xcodeproj

Create and modify Xcode projects from Ruby.
http://rubygems.org/gems/xcodeproj
MIT License
2.35k stars 455 forks source link

`XCSwiftPackageProductDependency` attempted to initialize an object with unknown ISA `XCLocalSwiftPackageReference` from attributes: `{"isa"=>"XCLocalSwiftPackageReference", "relativePath"=>"MyLocalSwiftPackage"}` #912

Closed philongho closed 1 year ago

philongho commented 1 year ago

Steps:

  1. Create an xcode project
  2. Add a local package dependency
  3. Build project using command bundle exec fastlane gym

Expected: I am able to build this project using xcodebuild CLI tool. Xcodeproj should be able to parse my project

Actual: Xcodeproj fail to parse my xcodeproj bundler: failed to load command: fastlane.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:359:in rescue in object_with_uuid': [!]XCSwiftPackageProductDependencyattempted to initialize an object with unknown ISAXCLocalSwiftPackageReferencefrom attributes:{"isa"=>"XCLocalSwiftPackageReference", "relativePath"=>"Dependencies"}(RuntimeError)

The isa generated by Xcode

/* Begin XCLocalSwiftPackageReference section */
        FD901FD62A33650700CF90D4 /* XCLocalSwiftPackageReference "Dependencies" */ = {
            isa = XCLocalSwiftPackageReference;
            relativePath = Dependencies;
        };
/* End XCLocalSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
        FD901FDA2A336E6200CF90D4 /* MfaDependencies */ = {
            isa = XCSwiftPackageProductDependency;
            package = FD901FD62A33650700CF90D4 /* XCLocalSwiftPackageReference "Dependencies" */;
            productName = MfaDependencies;
        };
/* End XCSwiftPackageProductDependency section */
mainGroup = 7555FF72242A565900829871;
packageReferences = (
FD901FD62A33650700CF90D4 /* XCLocalSwiftPackageReference "Dependencies" */,
);
productRefGroup = 7555FF7C242A565900829871 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
7555FF7A242A565900829871 /* iosApp */,
FD67D1612935BB72002500E2 /* iosAppUnitTests */,
FD67D17E2935CE91002500E2 /* iosAppUITests */,
);
dnkoutso commented 1 year ago

This was fixed here but has not been released yet https://github.com/CocoaPods/Xcodeproj/pull/911

Waiting on subsequent Xcode 15 betas before we make a release. In the meantime use bundler to pull down master version of Xcodeproj gem.

EdwardCYQ commented 1 year ago

@dnkoutso Hello, how long do I have to wait before the new version is released?