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

Android v4 to v5 NativeModules argument mismatch – Required Google Play upgrade #795

Open
4 of 5 tasks
masiamj opened this issue Nov 23, 2023 · 9 comments
Open
4 of 5 tasks
Labels
bug Something isn't working

Comments

@masiamj
Copy link

masiamj commented Nov 23, 2023

Describe the bug
Hi all, first-off thanks for your awesome library. I love this package and the RevenueCat ecosystem.

Unfortunately, upon submitting a new version of my app to the Play Store this week I was met with an error that the Google Play Store billing API version has been deprecated and must be upgraded before submitting a new version. Admittedly, my team is way out of date here.

image

As such, I would like to perform an upgrade from react-native-purchases@4 to react-native-purchases@5 which should be mostly backward compatible (without changing the structure of our subscription packages).

I spent time reviewing the changelog and decided to upgrade to v5.16.0 and followed the guide here: https://github.com/RevenueCat/react-native-purchases/blob/main/v4_to_v5_migration_guide.md.

For the most part this was extremely smooth and the naming convention changes and configuration API changes make sense and are very reasonable.

I was then able to bundle the aab; however, upon testing my app, I'm receiving crashes due to a native module argument mismatch. See the error here:
image

I reviewed the package code and native code being called and it appears that everything should be fine. The logcat message is correct that the native module requires 6 arguments and I can confirm that the JS layer does pass all the required arguments.

So now, I'm just a little stuck and would love any help/input/insights your team or the community may have. This is a blocker for me releasing the next version of our app.

Thanks so much!

  1. Environment
    1. Platform: Android
    2. SDK version: 33
    3. OS version:
    4. Xcode/Android Studio version: Build #AI-223.8836.35.2231.10671973, built on August 17, 2023
      Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64
    5. React Native version: 0.70.5
    6. SDK installation (CocoaPods + version or manual):
    7. How widespread is the issue. Percentage of devices affected.
  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
It looks like others are having this issue as well but was previously closed due to inactivity: #159.

@masiamj masiamj added the bug Something isn't working label Nov 23, 2023
@RCGitBot
Copy link
Contributor

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@tonidero
Copy link
Contributor

Hi @masiamj, thanks for reaching out!

First of all, you will need to upgrade at least to version 6.x in order to get the BC5 update, as mentioned here. We have a migration guide for that version here. But we do recommend updating to v7 if possible to get one more year of support from Google, since changes from v6 to v7 at the API level should be minimal.

As for your issue, I was checking the code and we're passing 6 parameters for that method: https://github.com/RevenueCat/react-native-purchases/blob/5.16.0/src/purchases.ts#L287.

A couple of questions:

  • How are you calling Purchases.configure? A snippet of code would be helpful.
  • Could you try to remove your node_modules folder and install your dependencies again? I wonder if you have the wrong version cached somewhere.

@masiamj
Copy link
Author

masiamj commented Nov 24, 2023

Hi @tonidero thanks for your quick response, without upgrading fully to v6, here's an update to your questions:

Per the Purchases.configure code, we're using it like so at the top-level of our app:

useEffect(() => {
        const purchaseInit = async () => {
            try {
                Purchases.configure({
                    apiKey: Config.REVENUECAT_KEY,
                })

                if (__DEV__) {
                    await Purchases.setDebugLogsEnabled(true);
                }
            } catch (e) {
                logger.error('Purchase initialization', e);
            }
        };

        purchaseInit();
    }, []);

I have tried wiping node_modules several times and refreshing Gradle dependencies; however, I'm still stuck here.

Any other thoughts or information I can provide to help? Thanks!

@tonidero
Copy link
Contributor

Hi @masiamj, one more question, does this happen for iOS as well?
Also some things you can try:

  • Clear your android's app build folder: cd android && ./gradlew clean
  • Clear react native cache: npx react-native start --reset-cache
  • Make sure the version inside your node_modules/react_native_purchases/package.json is correct.

@masiamj
Copy link
Author

masiamj commented Nov 28, 2023

Hi @tonidero this behavior is not happening on iOS as well.

I've tried your other suggestion and unfortunately none have worked. I'll keep working on it and hopefully will respond with an answer.

@chandchawla324
Copy link

chandchawla324 commented Dec 11, 2023

Hi @tonidero @masiamj @Team
When this issue will fixed ?

@KenRiku
Copy link

KenRiku commented Jan 12, 2024

hey team, any update for this? We are blocked from using RevenueCat as our purchase system because Google doesn't like Play Billing Library 4.0 any more. is there any temporary workaround while we wait for the update?

@mjubilee1
Copy link

Also facing the same is from Google Play Billing needing Library 4.0 or greater

@tonidero
Copy link
Contributor

tonidero commented Mar 1, 2024

Hi! Sorry for missing this issue

@KenRiku and @mjubilee1, our latest React Native SDK uses Billing client 6. What version are you trying to use? Also, that issue seems unrelated to this one. Please open a different ticket if you still have issues after updating to the latest version! 🙏

@masiamj @chandchawla324 Really sorry for the delay. I gave it another try and I was still not able to reproduce... Could you provide a minimum reproducible project where this issue happens? It still seems as if it's using an outdated version somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants