Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'NSInvalidArgumentException' after presenting GiphyViewController() #104

Closed
DanielZanchi opened this issue Sep 30, 2020 · 17 comments
Closed

Comments

@DanielZanchi
Copy link

I'm trying to present the GiphyViewController() but I get this error:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PINCache containsObjectForKey:]: unrecognized selector sent to instance 0x6000007a2940'

In my AppDelegate (didFinishLaunchingWithOptions) I'm running:
Giphy.configure(apiKey: "my api key")

In my view controller I'm presenting the Giphy UI Controller this way:

let giphy = GiphyViewController()
giphy.mediaTypeConfig = [.gifs, .stickers]
present(giphy, animated: true)

As soon as the Giphy controller appears the application crashes with the error I quoted above.
Why is this happening?

@cgmaier
Copy link
Contributor

cgmaier commented Sep 30, 2020

hey @DanielZanchi, seems like there could be a mismatch of PINCache versions. not sure how that would arise as the required PINCache version is defined in the Giphy.podspec file.

can you please clarify

  • what version of PINCache is denoted in your Podfile.lock
  • are you using PINCache independently of GIPHY?

I also recommend trying the following commands:

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update Giphy

@DanielZanchi
Copy link
Author

DanielZanchi commented Sep 30, 2020

Inside the Podfile.lock I see that it's using PINCache 2.0.
I'm not using PINCache independently of GIPHY.

I tried does commands but they didn't help.

@cgmaier
Copy link
Contributor

cgmaier commented Sep 30, 2020

I tried making a new test app and was not able to reproduce any crash. without additional details or a sample project, I can't help

@DanielZanchi
Copy link
Author

I tried making a new test app and was not able to reproduce any crash. without additional details or a sample project, I can't help

What version do you have on your Podfile.lock?

@DanielZanchi
Copy link
Author

Fixed using this in my podfile:
pod 'Giphy', :podspec => 'https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/2.0.1/Giphy.podspec'

@cgmaier
Copy link
Contributor

cgmaier commented Sep 30, 2020

what version of Giphy were you using before? what Xcode version are you using?

@DanielZanchi
Copy link
Author

Xcode version 12.0.1

Before I imported Giphy with pod Giphy

@delba
Copy link

delba commented Oct 2, 2020

Same issue after clearing the cache and updating from 2.0.2 to 2.0.3:

-[PINCache containsObjectForKey:]: unrecognized selector sent to instance 0x2825145a0

Giphy 2.0.2 used to rely on PINCache (not versioned but resolved to 3.0.1).
Giphy 2.0.3 relies on PINCache ~> 2.0.0 (effectively uses 2.0).

@cgmaier what version of PINCache do you see in your Podfile.lock ?
By the way, the test app attached to v2.0.3 still uses https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/2.0.1/Giphy.podspec. Maybe it's why you can't reproduce ?

@AlexClarkQP
Copy link

For what it's worth this is happening to me as well. Unfortunately I need Giphy 2.0.3 for the fixes to the AV Foundation compilation error with previous versions (so going back to 2.0.1 won't work for me).

Looks like if I go pre 2.0.3 I can't compile (AV Foundation error) and if I go 2.0.3 I can't select any Giphy (unrecognized selector error). I'm happy to help and provide any more info if it helps speed things along. Right now I'm in Giphy limbo.

@cgmaier
Copy link
Contributor

cgmaier commented Oct 3, 2020

hey guys, sorry for the lack of support and proper documentation here. I believe this issue is a matter of deployment target. GIPHY 2.0.3 requires iOS 10.2 or above - if your deployment target is below 10.2, CocoaPods won't fetch 2.0.3.

I believe there were technically reasons for this change - hopefully this is not overly restrictive.

as always, thanks for your patience. we are currently working on a more sustainable system for distributing and maintaining the GIPHY SDK.

@AlexClarkQP
Copy link

No worries, you guys are always super helpful. My deployment target is 13.0 but I still get Giphy 2.0.2 on pod update if that helps any.

@cgmaier
Copy link
Contributor

cgmaier commented Oct 3, 2020

can you check the deployment target in specific target settings rather than project settings? there must be something about your Xcode project or Podfile which is instructing CocoaPods that 10.2 is too restrictive

@AlexClarkQP
Copy link

Here are the xcode settings and podfile targets. Please let me know if anything else is helpful.

Screen Shot 2020-10-03 at 12 40 54 PM

Screen Shot 2020-10-03 at 12 37 33 PM

Screen Shot 2020-10-03 at 12 35 09 PM

Screen Shot 2020-10-03 at 12 34 53 PM

Screen Shot 2020-10-03 at 12 34 28 PM

@robksawyer
Copy link

My deployment target is 13.2 and I have the latest Giphy pod 2.0.3 (right?) and it's having the same issue.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PINCache containsObjectForKey:]: unrecognized selector sent to instance 0x283923150'
terminating with uncaught exception of type NSException
Installing AHKNavigationController (1.3)
Installing Alamofire (4.9.1)
Installing Alamofire-SwiftyJSON (3.0.0)
Installing AlamofireImage (3.6.0)
Installing AppAuth (1.4.0)
Installing DeepDiff (2.3.1)
Installing FBSDKCoreKit (5.15.1)
Installing FLAnimatedImage (1.0.12)
Installing FacebookCore (0.9.0)
Installing Firebase (6.33.0)
Installing FirebaseABTesting (4.2.0)
Installing FirebaseAnalytics (6.8.3)
Installing FirebaseAuth (6.9.2)
Installing FirebaseCore (6.10.3)
Installing FirebaseCoreDiagnostics (1.7.0)
Installing FirebaseCrashlytics (4.6.1)
Installing FirebaseInstallations (1.7.0)
Installing FirebaseInstanceID (4.7.0)
Installing FirebaseMessaging (4.7.0)
Installing FirebasePerformance (3.3.0)
Installing FirebaseRemoteConfig (4.9.0)
Installing GTMSessionFetcher (1.4.0)
Installing Giphy (2.0.3)
Installing GoogleAppMeasurement (6.8.3)
Installing GoogleDataTransport (7.4.0)
Installing GoogleToolboxForMac (2.2.2)
Installing GoogleUtilities (6.7.2)
Installing Hero (1.5.0)
Installing Kingfisher (5.15.5)
Installing NYTPhotoViewer (1.1.0)
Installing PINCache (2.0)
Installing PanModal (1.2.7)
Installing Player (0.13.3)
Installing PromisesObjC (1.2.10)
Installing Protobuf (3.13.0)
Installing PryntTrimmerView (4.0.2)
Installing RSKImageCropper (2.3.0)
Installing SDWebImage (5.9.2)
Installing SendBirdSDK (3.0.202)
Installing SendBirdSyncManager (1.1.31)
Installing SnapSDK (1.6.5)
Installing SteviaLayout (4.7.3)
Installing SwiftLocation (4.2.0)
Installing SwiftyBeaver (1.9.2)
Installing SwiftyJSON (4.0.0)
Installing WLEmptyState (3.1.0)
Installing YPImagePicker (4.4.0)
Installing libwebp (1.1.0)
Installing nanopb (1.30906.0)
Generating Pods project
Integrating client project

@robksawyer
Copy link

So when I installed the version 2.0.1, this happened.

Installing Giphy 2.0.1 (was 2.0.3)
Installing PINCache 3.0.1 (was 2.0)

Why is an older version of PINCache being used with a new version of Giphy?

@robksawyer
Copy link

robksawyer commented Oct 6, 2020

I fixed my issue by using
pod 'Giphy', :podspec => 'https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/2.0.2/Giphy.podspec'

@cgmaier
Copy link
Contributor

cgmaier commented Oct 6, 2020

hey all, apologies for this issue. thanks again for your patience. this should be fixed in 2.0.4 which you can get via

pod 'Giphy'

and pod update Giphy
or

pod 'Giphy', :podspec => 'https://s3.amazonaws.com/sdk.mobile.giphy.com/SDK/2.0.4/Giphy.podspec'

@cgmaier cgmaier closed this as completed Oct 23, 2020
djrluna pushed a commit that referenced this issue Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants