Program type already present: com.android.vending.billing.IInAppBillingService

  • Whenever you trying to adding google play billing library with

implementation 'com.android.billingclient:billing:version-code'

  • You must remove IInAppBillingService.aidl file from your project.

check this path of IInAppBillingService.aidl in Project level view

  • path :- app > src > main > aidi and so on...

You just delete this aidi folder or delete IInAppBillingService.aidl and rebuild your project. An error will disappear.


Before I explain my fix, let me tell you how did I managed to create it.

I started with Ionic In App Purchase 2 , worked perfect in development, after I've deployed with

ionic cordova build android --prod --release

Fail! Doesn't work

Ok! I thought I need to take another approach / package, so I've go to In App Purchase (version 1 if we want to call it)

After 1 try without luck in development mode, I thought , ok lets go back to Version 2, so when I've tried to deploy, 0 success!

I tried the following things that worked for me

  1. Delete node_modulesfolder
  2. Run npm install
  3. Run ionic cordova platform remove android && ionic cordova platform add android

So we are clean... now the most important piece , you can't have multiple versions of in-app-purchase , so my solution was to remove the version 1.

  1. Run cordova plugin remove cordova-plugin-inapppurchase

Just to be sure if you are clean , you shouldn't be able to find any of these 2

enter image description here


Delete the IinAppBillingService.aidl file from the android studio and just run the app again. Hope this will help.


Solution was close: Finally was able to resolve problem by simple deleting of aidl import lib, now compilation success on both debug and release, don't know why like this, Documentation seems outdated for inAppPurchases in google, seems this class is added from somewhere automatically.