purchases-flutter
purchases-flutter copied to clipboard
[Could not build app because of Duplicate of classes in module]
- [x] I have updated Purchases SDK to the latest version
- [x] I have read the Contribution Guidelines
- [x] I have searched the Community
- [x] I have read docs.revenuecat.com
- [x] I have searched for existing Github issues
‼️ Required data ‼️
Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.
There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!
Environment
-
[x] Output of
flutter doctor
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-arm, locale en-VN) [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.1) [✓] VS Code (version 1.70.0) [✓] Connected device (3 available) [✓] HTTP Host Availability -
[x] Version of
purchases-flutter
: 4.0.0 -
[x] Testing device version: Android API 30
-
[x] How often the issue occurs: every time I use
flutter run
-
[ ] Debug logs that reproduce the issue
-
[ ] Steps to reproduce, with a description of expected vs. actual behavior Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Describe the bug
Lot of classes was duplicated between module jetified-amazon-appstore-sdk-3.0.2
& module jetified-in-app-purchasing-2.0.76
.
Logs:
- Duplicate class com.amazon.device.iap.model.UserDataResponse found in modules jetified-amazon-appstore-sdk-3.0.2 (com.amazon.device:amazon-appstore-sdk:3.0.2) and jetified-in-app-purchasing-2.0.76 (in-app-purchasing-2.0.76.jar)
- Duplicate class com.amazon.device.iap.model.UserDataResponse$RequestStatus found in modules jetified-amazon-appstore-sdk-3.0.2 (com.amazon.device:amazon-appstore-sdk:3.0.2) and jetified-in-app-purchasing-2.0.76 (in-app-purchasing-2.0.76.jar)
- Go to the documentation to learn how to Fix dependency resolution errors.
Additional context
I have run flutter clean
then flutter pub get
but it doesn't work.
👀 SDKONCALL-86 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
same issue here. Waiting for the fix. Thanks!
Are you upgrading from an alpha/beta version where you had to manually download the amazon jar into the libs folder of your Android project? We used to depend on in-app-purchasing-2.0.76
and we used to require folks to download the jar manually, but we now download the dependencies automatically, so you can remove that .jar from your project.
No, I have upgraded the dependency from v3.9.5 officially from pub.dev.
Sorry, I've checked again and it actually was upgraded from v3.10.0
Interesting... Can you paste here your set of dependencies from your pubspec.yaml?
My set of dependencies:
dependencies:
flutter:
sdk: flutter
# In-App-Purchase & Admob
google_mobile_ads: ^2.0.0
app_tracking_transparency: ^2.0.2+4
flutter_inapp_purchase: ^5.3.1
# RevenueCat
purchases_flutter: ^4.0.0
I've found that inside build.gradle
of flutter_inapp_purchase
they are depending on
group 'com.dooboolab.flutterinapppurchase'
version '1.0-SNAPSHOT'
...
dependencies {
...
implementation files('jars/in-app-purchasing-2.0.76.jar')
}
which could cause this conflict.
Yes, that's exactly what's happening. Do you need that dependency? Are you using RevenueCat in observer mode? If not, you should remove it from your project and only have RevenueCat's.
That Amazon in-app-purchasing-2.0.76 dependency has been updated to version 3.0.3, which is now distributed in Maven. If they update to use 3.0.3 and remove the jar from their plugin, there won't be any conflicts with ours.
@dtvtkien and @uzumaki258 were you able to solve this?
I'm tentatively closing this one out, but let us know if you're still running into issues.
Hi, maybe it's a bit late, but I've fixed it by doing this:
- Removed
implementation files('jars/in-app-purchasing-2.0.76.jar')
- Added
implementation 'com.amazon.device:amazon-appstore-sdk:3.+'
Official sdk docs: https://developer.amazon.com/docs/appstore-sdk/integrate-appstore-sdk.html
Hello i am facing same error and i have same dependency like flutter_inapp_purchase: , purchases_flutter:
i have latest version of both what should i do now?