I'm trying to implement an in-app purchase in one of my apps. I'm running Android Studio 3.0.1 and i think everything is up to date. but when i go to the sdk manager (Tools->Android->Sdk Manager) the Google Play Billing Library is missing. I've tried updating everything i can think off. i download goolges test application and it seemed fine. following these instructions android billing my app will no longer comile. is this needed? can i install it another way? any ideas?
Asked
Active
Viewed 2,579 times
0

branedge
- 115
- 3
- 14
2 Answers
1
Just add the following dependency in the build.gradle file
implementation 'com.android.billingclient:billing:1.1'

Mitkumar Patel
- 91
- 4
0
As per the instructions here have you added the gradle dependency?
Add the following line to the dependencies section of the build.gradle file for your app:
dependencies {
...
compile 'com.android.billingclient:billing:1.0'
}

Nick Fortescue
- 13,530
- 1
- 31
- 37
-
i added it to the dependencies section o f the build.gradle (module:App) section. but when i try to rebuild the project it fails with: Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/android/vending/billing/IInAppBillingService; – branedge Feb 26 '18 at 14:11
-
may have fixed this error, prior to adding that line i had created the aldi directory and added the IInAppBillingService file i've removed that and it is now building, still no Google Play Billing Library but going back through the link you sent – branedge Feb 26 '18 at 14:16