jonreid / OCMockito

Mockito for Objective-C: creation, verification and stubbing of mock objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not build OCMockito using Carthage

MarcoBrescianini opened this issue · comments

Hello @jonreid I'm having some issues updating OCMockito to v7.0.1 version using Carthage as dependency manager.
I'm using both OCMockito and OCHamcrest. Everything worked fine until I tried to update both dependencies to the latest versions.
If I run carthage update --use-xcframeworks --platform iOS carthage build fails with the following error:

*** Building scheme "OCHamcrest-iOS" in OCHamcrest.xcodeproj
*** Building scheme "OCMockito-iOS" in OCMockito.xcodeproj
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /PROJECT_PATH/Carthage/Checkouts/OCMockito/Source/OCMockito.xcodeproj -scheme OCMockito-iOS -configuration Release -derivedDataPath /Users/MYUSER/Library/Caches/org.carthage.CarthageKit/DerivedData/13.2.1_13C100/OCMockito/v7.0.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO -archivePath /var/folders/7_/0_0qpm2d42j6y9rdhw5ns8nw0000gn/T/OCMockito SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /PROJECT_PATH/Carthage/Checkouts/OCMockito)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details

Following there's an excerpt of the Carthage build log:

note: Build preparation complete
note: Building targets in dependency order
error: There is no XCFramework found at '/PROJECT_PATH/Carthage/Checkouts/OCMockito/Frameworks/OCHamcrest-9.0.1/OCHamcrest.xcframework'. (in target 'OCMockito-iOS' from project 'OCMockito')
** ARCHIVE FAILED **

As you might have noticed it seems it cannot find OCHamcrest framework in the 9.0.1 folder. It seems like it is searching for OCHamcrest 9.0.1 version but in the OCMockito Cartfile it is stated that OCHamcrest should be at least version 8.0.0. I've found that in the v7.0.0 release notes you stated that OCMockito requires OCHamcrest 9.0.0.

Are the Cartfile and the podspec broken or am I missing something?

Thank you

I dropped support for Carthage. It's a shame, but I don't know a workaround. The README says:

Unfortunately, shifting the OCHamcrest dependency to an XCFramework has meant dropping support for Carthage. Please let me know if this situation changes.

Got it! I didn't read the Readme file.
Thank you for your reply and your patience.

If you ever hear about Carthage supporting dependent XCFrameworks, please ping me!