It appears adding iOS SDK with Swift PM is broken right now (workaround included)
Hi,
I’m new to RevenueCat and just following the Quick Start for iOS.
I tried to add the SDK using the instructions but Xcode could not resolve the dependency (tried Xcode 12.5 and 13 beta 5).
It seems that since the new 4.0.0 beta SDK released 2 days ago, Xcode can’t resolve it. It defaults to using 4.0.0 as the minimum version and then fails to resolve it.
I have managed to work around this by entering 3.12.4 as the version when adding the dependency, but thought I’d raise this in case (a) I’m doing something wrong (don’t fancy using Beta right now so...), and (b) RC are not aware of the problem.
I just tried this on a testing app, and it works correctly for me, but in order to get it to work, you have to specify the number number as `4.0.0-beta.1`.
Could you give it a shot?
Thanks @Andy — still no dice here in Xcode 13 beta 5, probably because I have my project set to treat warnings as errors. It won’t build the package even with that version change:
Invalid Exclude '/Users/marc/Library/Developer/Xcode/DerivedData/Captionista-dhlqkvltvxzowycfexhqwsaswlxg/SourcePackages/checkouts/purchases-ios/Purchases/RequiresXcode13': File not found.
The broader point however is that I’m trying to be helpful to RC. The default experience with SPM right now is that it does not resolve it correctly, seemingly because it defaults to 4.0.0 as the version, not 4.0.0-beta.1
This seems like a problem?
@Marc Palmer And helpful you very much are!!
I hadn’t caught the issue with the invalid exclude, thanks for reporting it! We’re indeed pointing to the wrong path in `Package.swift`, when trying to exclude a folder. We’re going to issue a fix for it. And yes, I believe it’s because of the “treat warnings as errors” build setting, which is quite common (and usually a good idea to have).
Also, you’re correct, I hadn’t noticed that SPM seems to be defaulting to 4.0.0, even though the only 4.0.0 release is in beta state. We’re gonna try and figure out a workaround so that it doesn’t do that, since 4.0.0 isn’t quite ready for prime time yet.
Thanks for reporting these!
I’ll post again here when we have a new build with fixes.
Thanks for reporting these!
I’ll post again here when we have a new build with fixes.
Great, thanks. Just trying to help grease the wheels for others. Thought I’d try SPM first as the new hotness… be cool to be able to try the new Beta APIs too.
Just to say this is still broken today- setting the version to “4.0.0-beta.1” fixed it, and it then installed correctly.
Thanks for reporting! We’re still trying to figure out how to get SPM to recognize v4.0.0 as a pre-release so that it doesn’t default to it, ideally it’d default to 3.x.x until at least one release is made with v4. Sorry for the inconvenience!
Also, quick heads up that we just released `4.0.0-beta.2`, with some extra polish and fixes.
Thanks
I’m sure you know this, but also note that all the documentation mentions doing an
“import purchases”
whereas it needs to be
”import revenueCat”
Perhaps you can add a note to the top of the install instructions, until all the docs can be amended, for both things (i was stalled for an hour or two by the beta issue)
Peter
Sorry about that! And thanks for bringing it up! We’ll add a note to the docs and make sure that it’s clear from now on.
Let us know if you run into any other rough edges with the beta migration!!
I did also find that I couldn’t get the new version to see my products, which is odd as I was able to see them with Swiftystorekit (which I had been testing previously). It was giving an error in the console (something like “can’t find product named “null””)
Installing the oldest pre-4.0 version instead fixed it, and the products could all be seen
Hey @Peter Johnson, thanks so much for reporting this issue. We are very lucky to have beta testers like you!
That log is meant to warn users when a product is defined the in RC dashboard but can’t be found in StoreKit. You are seeing “null” due to an already-fixed bug in our error strings setup, wherein we didn’t pass the missing IDs to the string.
We also had a logic error around WHICH ids are missing, which my PR addresses.
However, this only addresses the warning log itself...can you please confirm whether you received the proper offerings and related products, regardless of the warning?
Sorry, can’t confirm either way, as I rolled back the version before I implemented the paywall screen code.
I DID see my two products correctly named a few lines above in the verbose debug info, without an error shown, but I couldnt be sure at that point whether the names were coming from the config file, RevenueCat or the AppStore.
Great, sounds like it was probably working then. Let us know if you run into anything else, and keep an eye out for our beta 3 release (hopefully today!)