2

I've quite literally tried everything and read every article/done hours of research. I cannot build my Xcode Project due to the fact it cannot find the module 'purchases' from: RevenueCat/purchases.

Everything was working well before I upgrade my Mac to the latest Ventura beta with the newest version of Xcode, where the issue started happening, I downgraded both my OS and Xcode thinking this issue would subside, but it hasn't.

I've tried resetting the package cache, deleting derived data, gone through each SO post and tried their answers, still nothing. Yes the module and it's packages/frameworks are apart of my target

enter image description here

Dean
  • 1,512
  • 13
  • 28
Nathan
  • 1,393
  • 1
  • 9
  • 40

1 Answers1

0

I had the issue this morning, and most of the issue was that I tried to upgrade from 3.x.x to 4.x.x at once, and swift compiler wanted to kill itself.

If you still use import Purchases ; then it's still 3.x.x and I solved it using:

products: [
  ...
  .library(name: "Premium", targets: ["Premium"]),
  ...
],
dependencies: [
  ...
  .package(url: "https://github.com/RevenueCat/purchases-ios.git", from: "3.0.0"),
  ...
],
targets: [
  ...
  .target(name: "Premium", dependencies: [
    .product(name: "Purchases", package: "purchases-ios"),
  ]),
  ...
]

Upgrading to 4.x.x wasn't that hard once I got 3.x.x compiling again.

This is what my Package.swift file looks like now:

products: [
  ...
  .library(name: "Premium", targets: ["Premium"]),
  ...
],
dependencies: [
  ...
  .package(url: "https://github.com/RevenueCat/purchases-ios.git", from: "4.0.0"),
  ...
],
targets: [
  ...
  .target(name: "Premium", dependencies: [
    .product(name: "RevenueCat", package: "purchases-ios"),
  ]),
  ...
]

And now, I need to use import RevenueCat as explained in the migration guide

Dean
  • 1,512
  • 13
  • 28