RevenueCat / purchases-ios

In-app purchases and subscriptions made easy. Support for iOS, watchOS, tvOS, macOS, and visionOS.
https://www.revenuecat.com/
MIT License
2.31k stars 309 forks source link

Unable to run cocoapods with Purchases pods #1063

Closed pradeepb28 closed 2 years ago

pradeepb28 commented 2 years ago

Describe the bug I've tried to run cocoapods but it says unable to find Purchases Here is how I included in the file

pod 'Purchases', :git => "https://github.com/RevenueCat/purchases-ios.git"

Output CleanShot 2021-12-13 at 13 29 54

  1. Environment
    1. Platform: iOS
    2. SDK version: n/a
    3. OS version: 11.3.1
    4. Xcode version: n/a
    5. How widespread is the issue. Percentage of devices affected: n/a
  2. Debug logs that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Additional context Add any other context about the problem here.

pradeepb28 commented 2 years ago

Also I've tried

 Pod Purchases

but I get this error CleanShot 2021-12-13 at 13 41 02

aboedo commented 2 years ago

Hi @pradeepb28! 👋 Thanks for reporting!

This is expected, here's what's going on:

Here's the list of everything that's changed in our V4 SDK, currently in beta.

pradeepb28 commented 2 years ago

@aboedo I tried

pod 'Purchases'

but I am still facing the below issue CleanShot 2021-12-13 at 18 05 39

MacOS: 11.3.1 (M1 machine) Pod version: 1.10.2

aboedo commented 2 years ago

🤔 I just tried this on a brand new project and had no issues with the following podfile:

target 'testCocoapods (iOS)' do
  use_frameworks!
  pod 'Purchases'
end

target 'testCocoapods (macOS)' do
  use_frameworks!
  pod 'Purchases'
end

Output:

image

@pradeepb28 I'm running Cocoapods 1.11.2. Perhaps updating your Cocoapods version solves the issue?

pradeepb28 commented 2 years ago

updated but still no luck. @aboedo is there any chance I can point to the git url. This is the only I was able to solve other pods in my file. I tried the git url under purchases-ios but it didnt worked(as per my original issue)

aboedo commented 2 years ago

@pradeepb28 is there anything more in the output other than what you pasted above? Anything before "oh no, an error occurred"?

I wonder if there might be an issue with targeted architectures or deployment targets, could you share details about which architectures your app is targeting, as well as deployment targets for them?

You can still point to the github url:

For the stable version, v3:

pod 'Purchases', :git => 'https://github.com/RevenueCat/purchases-ios.git', :tag => '3.13.1'

Keep in mind that if you go with this path, you'd have to update the tag whenever you want to update to a newer version fo the SDK to get bug fixes or new features.

For the beta version, v4 (keep in mind the API updates):

pod 'RevenueCat', :git => "https://github.com/RevenueCat/purchases-ios.git"
pradeepb28 commented 2 years ago

This is what is in podfile @aboedo

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Bird search' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
platform :ios, '15.0'

  # Pods for Bird_search
pod 'RevealingSplashView', :git => "https://github.com/PiXeL16/RevealingSplashView.git"
pod 'Mixpanel-swift', :git => "https://github.com/mixpanel/mixpanel-swift.git"
pod 'SwiftDate', :git => "https://github.com/malcommac/SwiftDate.git"
pod 'Purchases'

end

Output attached here Terminal Saved Output.zip

aboedo commented 2 years ago

Thanks for sharing! I think you're experiencing this issue.

It seems to be an incompatibility issue with a ruby gem called ffi, there's a suggested workaround here.

There's another thread here for the same issue.

There are a few other possible solutions in the links I posted. Would you mind giving them a shot?

pradeepb28 commented 2 years ago

@aboedo it worked, finally I can give a shot on RevenueCat

aboedo commented 2 years ago

Glad it's working! Let us know if you run into more issues. Have a great day!

github-actions[bot] commented 2 years ago

This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.