Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in Adding the In-app Billing Library

I was doing this following these steps as mentioned in the link.

  1. Copy the IInAppBillingService.aidl file to your Android project. (1) If you are using Eclipse: Import the IInAppBillingService.aidl file into your /src directory. (2) If you are developing in a non-Eclipse environment: Create the following directory /src/com/android/vending/billing and copy the IInAppBillingService.aidl file into this directory.
  2. Build your application. You should see a generated file named IInAppBillingService.java in the /gen directory of your project.
  3. Add the helper classes from the /util directory of the TrivialDrive sample to your project. Remember to change the package name declarations in those files accordingly so that your project compiles correctly.

But when I finished that, Eclipse gives me an error:

interface IInAppBillingService should be declared in a file called com\android\vending\billing\IInAppBillingService.aidl. 

the aidl file is in the correct directory, but the IInAppBillingService.java file was not generated.

Has anybody seen that before?

like image 815
StupidCodeGenerator Avatar asked Dec 18 '12 06:12

StupidCodeGenerator


2 Answers

right click on the head of the project and create a new PACKAGE ... call the package com.android.vending.billing ....drop the aidl file in there to quiet the error.

Some food for thought: for those with an interest - when using someone's aidl file, the package name for both apps must be the same. google used com.android.vending.billing as their package name for their billing aidl interface, so you MUST also use the same package name in your app. This is the rule when using aidl.

like image 174
j2emanue Avatar answered Sep 21 '22 23:09

j2emanue


For android studio users, this should be the structure:

enter image description here

Worked for me, according to this answer.

like image 42
David Avatar answered Sep 20 '22 23:09

David