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

Crash - unrecognized selector sent to instance #13

Closed
Csaba8472 opened this issue Jan 25, 2021 · 21 comments
Closed

Crash - unrecognized selector sent to instance #13

Csaba8472 opened this issue Jan 25, 2021 · 21 comments

Comments

@Csaba8472
Copy link

First of all, thank you for the library!

With the latest Xamarin.iOS - xcode versions when I try to init RCPurchases:
RCPurchases.DebugLogsEnabled = true; RCPurchases.ConfigureWithAPIKey(API_KEY);

I get this exception:
[RCPurchases configureSubscriberAttributesManager]: unrecognized selector sent to instance

and RCPurchases.SharedPurchases is not initialised.

Full log:

[Purchases] - DEBUG: Initial App User ID - (null)
[Purchases] - DEBUG: Generated New App User ID - $RCAnonymousID:e8002ee99a544cfe848e6b4dc4dcff36
[Purchases] - DEBUG: GET /v1/subscribers/$RCAnonymousID:e8002ee99a544cfe848e6b4dc4dcff36
[Purchases] - DEBUG: GET /v1/subscribers/$RCAnonymousID:e8002ee99a544cfe848e6b4dc4dcff36/offerings
-[RCPurchases configureSubscriberAttributesManager]: unrecognized selector sent to instance 0x28354d0e0
[Purchases] - DEBUG: GET /v1/subscribers/$RCAnonymousID:e8002ee99a544cfe848e6b4dc4dcff36/offerings 200
[Purchases] - DEBUG: Requesting products with identifiers: {(

Tried 3.5.3.10 and 3.5.3.8 and both had this issue.

Also tried to update, but it seems from 3.6.0 the lib is modularized, and it has swift code too, so this method didn't work.

What did I do wrong?

@thisisthekap
Copy link
Owner

@Csaba8472 Everything seems to be working just fine on our side (also when using newest xcode/sdks).

I will try to investigate the issue in detail today or tomorrow.

@thisisthekap
Copy link
Owner

@Csaba8472 Tried to reproduce this issue. No success. What device and os are you deploying to?

@Csaba8472
Copy link
Author

The easiest way is to create a new single view project, add Xamarin.RevenueCat.iOS and Xamarin.RevenueCat.iOS.Extensions and call it:

RCPurchases.DebugLogsEnabled = true; RCPurchases.ConfigureWithAPIKey(API_KEY);

revcattest
(removed the API key before I created the screenshot)

Tried to run it on simulator with iOS 14.3. I don't think that simulator is the problem because revenuecat's native lib doesn't crash.

@thisisthekap
Copy link
Owner

@Csaba8472 Thanks for that, will try to have a look into that one later today.

@thisisthekap
Copy link
Owner

Current state:

  1. I am able to reproduce the issue using a new project
  2. Our own usage of the nugets is working just fine (xamarin forms solution)
  3. The UsageChecker project ist working just fine

Currently, I have no clue on the cause of this issue. Further investigation is needed.

@Csaba8472 Do you know additional details, or hints on possible causes?

@thisisthekap
Copy link
Owner

@Csaba8472 I think I got it.

Please try to add <MtouchExtraArgs>-gcc_flags "-ObjC"</MtouchExtraArgs> to your project file.

If you prefer the UI dialog:
image

@Csaba8472
Copy link
Author

Thank you that solved the issue. In the meantime, I've wrapped RevenueCat's newest lib, do you plan to release an update to this lib which supports the newest RevenueCat lib?

@thisisthekap
Copy link
Owner

@Csaba8472 Awsome!

So you successfully created Xamarin.iOS Bindings for the newest version of the RevenueCat SDK? If so: A PR would be very much appreciated!😎

@thisisthekap
Copy link
Owner

As #14 documents this fix in README.md, I think this issue can be closed. @Csaba8472 Do you agree?

@thisisthekap
Copy link
Owner

@Csaba8472 Did you manage to create the Xamarin.iOS Bindings for the newest version of the RevenueCat SDK?

@Csaba8472
Copy link
Author

Yep, I agree, thank you for investigating it. Sort of, as the newest sdk is in swift I couldn't manually generate all the methods, instead I only wrapped the swift methods to objc which I needed and then I could bind those methods.

@thisisthekap
Copy link
Owner

@Csaba8472 As this imho is currently the only way to do propper swift bindings (https://github.com/xamarin/binding-tools-for-swift will most likely take some time to become stable), I think your new bindings are definitely worth a contribution.

Looking forward to your PR! 😊

@thisisthekap
Copy link
Owner

@Csaba8472 Did you manage to create a working wrapper for the swift library?

@Csaba8472
Copy link
Author

sorry forgot to write, still haven't had time to wrap all the methods. My current approach is creating a slim binding around RevenueCat.

@thisisthekap
Copy link
Owner

I am willing to assist you on that.

If you agree: Please create a PR, mark it as draft, and add me as a contributor to your fork.

@Csaba8472
Copy link
Author

Uploaded what I currently have. As it needs different approach, we have to start the project from the grund up. You can check it here.

@thisisthekap
Copy link
Owner

@Csaba8472 Thank you very much!

As of now, i do not know when I am going to find the time to do the upgrade.

Your contribution is going to help me a fortune when doing so!

@Csaba8472
Copy link
Author

@thisisthekap I'm open to work on it, can you join to DotNetEvolution discord channel? We could chat there easier.

@thisisthekap
Copy link
Owner

@Csaba8472 My name in DotNetEvolution Discord: thekap#4353

@Csaba8472
Copy link
Author

can't find you, I'm Csaba8472 could you please ping me?

@thisisthekap
Copy link
Owner

@Csaba8472 whats the username incl. tag? (The number after the # in your Discord name)

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

2 participants