Open brahyam opened 1 month ago
Hi, thanks for the detailed report! I'm not entirely sure what's going wrong, as everything you shared looks correct.
The "unrecognized selector" error usually points to the linked framework (pod) being different from what the Kotlin code expects.
Some thoughts/questions/leads:
pod install --repo-update
afterwards? (Can't hurt to run that again, just in case.)po 0x106566110
in the lldb command prompt in the bottom right? Note that the memory address (0x106566110
) is likely different each time, so make sure you use the actual address reported in the crash.pod install --repo-update
after you made that change.Thanks @JayShortway will try again and paste the results shortly. Is there a way of achieving this without having to use CocoaPods? I'm not using them in my project and had to include them because of this.
I'm currently using https://github.com/mirzemehdi/KMPRevenueCat which doesnt need me to use Cocoapods and trying to migrate to the official one.
Also FYI the UI library is missing from the official docs installation section and the SDK reference,
Is there a way of achieving this without having to use CocoaPods?
Thanks for this feedback. You're the third one to ask, so it seems we should do something about it. 😄 The PR linked above should make it possible to integrate without CocoaPods.
Also FYI the UI library is missing from the official docs installation section and the SDK reference,
Regarding the Paywall docs, they are separate: https://www.revenuecat.com/docs/tools/paywalls. Regarding the SDK reference, you are right! That should be fixed by https://github.com/RevenueCat/purchases-kmp/pull/207, meaning they'll get updated with our next release.
Hi @brahyam, you should now be able to integrate PurchasesHybridCommonUI
without CocoaPods. Here's the URL to the repo: https://github.com/RevenueCat/purchases-hybrid-common/. Let me know how this works for you!
Oh boy, I am so looking forward to this. I only started the CocoaPods integration because of the Paywall, but that has been a lift that has stalled me for a week now. Will see if I can try with the SPM side of things, thank you.
Edit: I guess SPM hasn't picked up the new commit yet. So for now, you can use specify commit 886951d557fe8849dd1944548da1772d88968978 when selecting the package from this URL and it'll work as expected. https://github.com/RevenueCat/purchases-hybrid-common/
BELOW ISSUES RESOLVED - SEE EDIT ABOVE FYI @JayShortway I've tried a couple of different ways to add the Repo via Swift Package Manager and cannot get it to resolve. Maybe it's just me? I've tried both https://github.com/RevenueCat/purchases-hybrid-common/
and https://github.com/RevenueCat/purchases-hybrid-common.git
@adrianegraphene Thanks for figuring this out! It's probably because the Package.swift
file doesn't exist at the 13.2.1
tag. Will get a new release out so this workaround is no longer needed.
@adrianegraphene @brahyam Just FYI: starting with version 1.1.0+13.3.0
you should be able to integrate PurchasesHybridCommonUI
using the 13.3.0
version instead of the commit.
@JayShortway I just tried and I'm still getting the same error as @adrianegraphene (using both urls he mentioned)
I even tried using a commit number but still fails. But I clicked on add anyway and it worked.
Could it be because I still had the regular iOS RC package added?. After adding this one the package sync was failing to I had to remove the iOS one and reset packages cache for it to work.
Would be great if you could update the docs to show this way of adding it without using pods
Hi @brahyam, the docs have just been updated. This section is the one explaining how to integrate PurchasesHybridCommon
using Swift Package Manager.
It's indeed likely that your issue was caused by the fact that you still had the regular RevenueCat
package added. PurchasesHybridCommon
depends on RevenueCat
. Maybe the version you added was different from the one PurchasesHybridCommon
expects. In any case, the regular RevenueCat
package should not be added manually.
Describe the bug A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue. Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.
I'm trying to integrate the KMP SDK into a KMP app (including the Paywall UI). However when calling from KMP
The iOS app crashes with the error:
Purchases.configure(purchasesConfig)
to KMPDEPENDENCIES:
SPEC REPOS: trunk:
SPEC CHECKSUMS: PurchasesHybridCommon: 7955b21cc5a8be78cea6dcf92f3906f3e5cec972 RevenueCat: d9e8b1b56bf81483cf8bb902a952a2da8749b964
PODFILE CHECKSUM: 40220c225a9794bced0d516b00d95455a7211622
COCOAPODS: 1.15.2
revenuecat-purchases = "1.0.1+13.2.1"
revenuecat-purchases-core = { module = "com.revenuecat.purchases:purchases-kmp-core", version.ref = "revenuecat-purchases" } revenuecat-purchases-datetime = { module = "com.revenuecat.purchases:purchases-kmp-datetime", version.ref = "revenuecat-purchases" } revenuecat-purchases-ui = { module = "com.revenuecat.purchases:purchases-kmp-ui", version.ref = "revenuecat-purchases" }
kotlin { ... listOf( iosX64(), iosArm64(), iosSimulatorArm64() ).forEach { it.binaries.framework { baseName = "shared" isStatic = true ... } }
sourceSets { commonMain.dependencies { ... implementation(libs.revenuecat.purchases.core) implementation(libs.revenuecat.purchases.datetime) implementation(libs.revenuecat.purchases.ui)
Additional context KMP app, targeting android and iOS only. using XCframeworks other possible relevant versions: agp = "8.4.1" kotlin = "2.0.0" jetbrains-compose = "1.6.10"