Giter Club home page Giter Club logo

Comments (7)

sanathkukkillaya avatar sanathkukkillaya commented on June 14, 2024

Hi, I too am facing this issue. Looks like the RevenueCat billing library(v2.0.3) conflicts with the Unity billing library (v3.0.1). I am not sure if I should remove anything. Removing 2.0.3 might cause RevenueCat to fail, and removing 3.0.1 might cause issues, since Google is recommending to use v3 billing library. Any solution would help

from purchases-unity.

vegaro avatar vegaro commented on June 14, 2024

Releases of our SDK above 2.3.0 don't require extra steps when using alongside Unity IAP. This means that if someone is upgrading to 2.3.0 from a previous installation, they should remove this:

implementation ('com.revenuecat.purchases:purchases-hybrid-common:1.2.0') {
        exclude group: 'com.android.billingclient', module: 'billing'
}

Which were the previous instructions.

On top of that, if using a version of Unity IAP above 2.2.0, a version above 2.3.0 of our SDK needs to be used. In summary:

Unity IAP Compatible RevenueCat Notes
<2.2.0 <2.3.0 Follow instructions in https://docs.revenuecat.com/v3.0/docs/unity#installation-with-unity-iap-side-by-side
2.2.0+ 2.3.0+ No special instructions required, remove previous code added to gradle file if updating

I will make sure the docs are updated to reflect this. I am sorry it wasn't clear at all. Let us know if you are still facing this issue or it gets fixed. Thanks!

from purchases-unity.

imurashka avatar imurashka commented on June 14, 2024

Hey @vegaro! Thanks for your reply! I have tried to follow instructions for both cases (Unity IAP <2.2.0 and 2.2.0+) but still have the same problem.
What I did step by step:

  1. Created new unity project (unity verison is 2019.4.16 LTS)
  2. Added Unity IAP (version 2.2.0) package
  3. Downloaded latest RC from https://docs.revenuecat.com/docs/unity and imported it to project
  4. Run dependency resolver (Assets -> External Dependency Manager -> Android Resolver -> Force Resole)
  5. Start Android build
    After that step I have more than hundred errors in console after
    java.lang.RuntimeException: Duplicate class com.android.billingclient.BuildConfig found in modules classes.jar (:billing-3.0.1:) and classes.jar (:com.android.billingclient.billing-3.0.1:)

There is test project with error - RevenueCatTest.zip
I will be very happy if you will check it and probably point on my mistake.

from purchases-unity.

vegaro avatar vegaro commented on June 14, 2024

Thanks for sending that over! I will look into it now

from purchases-unity.

vegaro avatar vegaro commented on June 14, 2024

I think I figured it out. As you pointed out, the implementation alongside Unity IAP was broken. We are truly sorry about that.

Please let me know if the following instructions fix the issues you're facing, just in case I am missing something:

New instructions

If using RevenueCat alongside Unity IAP or other plugin that includes the Android BillingClient library you will be getting an error when compiling that warns about some BillingClient classes being duplicated.

The easiest way to remove the error would be to tell Gradle to not include the billingclient library that Unity IAP is already including.

In order to do that, make sure you have Custom Main Gradle Template selected in the Android Player Settings... That should create a mainTemplate.gradle inside the Assets/Plugins/Android.

Modify the mainTemplate.gradle to include the following at the end of the dependencies block:

dependencies {
     ...
    // ** ADD THIS **
    configurations.all {
        exclude group: 'com.android.billingclient', module: 'billing'
    }
}

from purchases-unity.

imurashka avatar imurashka commented on June 14, 2024

Hey @vegaro and thank you for the help. Very appreciated! I tried your solution and it works now :)

from purchases-unity.

vegaro avatar vegaro commented on June 14, 2024

That's great to hear! I will let our support team know and will update the docs. I am going to go ahead and close this issue. @gtino @sanathkukkillaya please let us know if the new instructions don't fix your issues, I believe they will

from purchases-unity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.