Hi Team, I am working on writing consumer contract...
# pact-swift
s
Hi Team, I am working on writing consumer contract test using PactSwift but In our company we are using cocoapods as dependency manager. I created xcFraework using Fastlane(fastlane run create_xcframework scheme:"PactSwift-iOS" xcframework_output_directory:"/Users/shankarnathreddy/projects/PactSwift" product_name:"PactSwift”) and Pod spec but I have below problems. Expected Result : I should be able to write consumer contract test. Actual Result : 1.PactSwift module itself is not coming to import in the test class after referencing this in our customer IOS APP project. (Error : No such module 'PactSwift') 2.I created separate test IOS project, manually added xcFraework to this project(without POD) and here I am able to import PactSwift module but getting error as "Failed to build module 'PactSwift' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug”. Environment : MacBook with Intel i9 and Xcode 13.2.1 Could you please help me here ? let me know if any further info is required.
m
https://github.com/Carthage/Carthage/issues/3270 Apple seems to have changed how they link transient binary dependencies at around Xcode 13.2. There has also just now been a change pushed to
main
(less than an hour ago). Perhaps try building your XCFramework with latest changes on
main
. Might started working. I've ran that and I haven't seen the same errors anymore. Carthage is still acting up.
s
Thanks marko for the quick response.
I will check this and let you know. Thank You Marko.
m
There still might be some hiccups though as I was just looking into this this arvo but haven’t pinpointed the exact issue yet. Using SPM is the only way I’ve been 100% without issues.
s
ok, I created xcframework with latest changes and it resolved problem2(referencing xcframework directly) but still problem1 is exists with cocoapods.
🙌 1
if i switch to latest version of xcode i.e 13.3, will this issue get resolved ?
m
Not sure about cocoapods. Am not using it (hate it wholeheartedly 🤷‍♂️ so any help from anyone is much appreciated) and PactSwift was never considered to be used through cocoapods. Actually SPM is going to be the only sure way for the future. Regarding a framework not being able to be imported I’ve experienced it’s a cache problem. Clearing the build folder “mostly” fixes the problem if the frameworks are built and linked properly.
👍 1
s
Now its working fine with xcode 13.2.1 only, pod target issue was there and now it got resolved.
💯 1
Thank You Marko