Comments (7)
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.
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.
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:
- Created new unity project (unity verison is 2019.4.16 LTS)
- Added Unity IAP (version 2.2.0) package
- Downloaded latest RC from https://docs.revenuecat.com/docs/unity and imported it to project
- Run dependency resolver (Assets -> External Dependency Manager -> Android Resolver -> Force Resole)
- 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.
Thanks for sending that over! I will look into it now
from purchases-unity.
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.
Hey @vegaro and thank you for the help. Very appreciated! I tried your solution and it works now :)
from purchases-unity.
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)
- error CS1525: Invalid expression term '>' HOT 5
- AmazonStore: "There as a problem with store. Code 2, UnderlyiningErrorMessage: Failed to get user data." HOT 11
- Unable to resubscribe after expiration in TestFlight/sandbox environment (many related posts before without a solution) HOT 16
- Receive Customer Info Bug HOT 3
- Purchases framework causes crash on older iOS devices HOT 14
- What about other Apple Platforms? MacOS/TVOS HOT 4
- Error parsing Discount objects in StoreProduct.cs HOT 4
- Add issue templates
- Game Crashes on Start (Android) HOT 1
- Random login errors HOT 4
- Trying to understand entitlements - Not a bug HOT 2
- Unity PostProcessBuild scripts for Xcode HOT 3
- 3.5.0 Version NoSuchMethodError getSkus() HOT 5
- 📣 Have a question? Please use https://community.revenuecat.com 😁 HOT 1
- Unable to distribute to App Store Connect, Invalid bundle HOT 11
- RevenueCat Purchases SDK doesn't get initialized HOT 4
- Crash when not setting `deprecatedLegacyRevenueCatAPIKey` on simulator HOT 4
- [URGENT - LIVE VERSION] User has been charged but purchase isn't showing up HOT 6
- Issue within BillingClient 4.0 - SkuDetails missing freeTrialPeriod HOT 1
- `namespace Editor` for Unity/iOS colliding with UnityEditor.Editor
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purchases-unity.