Solution for the in-app billing tutorial from Google (Android)

Solution for theĀ IInAppBillingService.aidl error in eclipse.

If you try to add the Google library android for the in-app billing, you will have this error: interface IInAppBillingService should be declared in a file called com\android\vending\billing\IInAppBillingService.aidl.

We will see how to solve this issue.

The error

In its tutorial (http://developer.android.com/training/in-app-billing/preparing-iab-app.html#GetSample), Google explains :

To add the In-app Billing Version 3 library to your existing In-app Billing project:

Copy the IInAppBillingService.aidlfile to your Android project.

  • If you are using Eclipse: Import the IInAppBillingService.aidl file into your /src directory.
Error when IInAppBillingService.aidl added

Error on IInAppBillingService.aidl

That is not exactly true. If you do that, you will have this error: IInAppBillingService should be declared in a file called com\android\vending\billing\IInAppBillingService.aidl.

The solution

  • Right click on src and make a new package: com.android.vending.billing.
Eclipse new package

Eclipse new package

 

 

 

 

 

New package com.android.vending.billing

New package com.android.vending.billing

 

 

 

 

 

 

 

 

 

  • Move the class IInAppBillingService.aidl in this new package (you can do that with the mouse).
Move InAppBillingService.aidl

Move InAppBillingService.aidl in the new package

 

 

 

 

 

 

 

  • Result: you can build your project (if you are not on built automatically). You should see:
In app billing solution

In app billing solution

 

 

 

 

 

 

 

 

 

You can discover my android applications on my apps page: http://www.wakeupsun.com/applications/

Wakeupsun

3 thoughts on “Solution for the in-app billing tutorial from Google (Android)

  1. Pingback: Android In-App-Billing Quick and Simple guide | RedAppz - Mobile Applications Design and Publishing

Leave a Reply

Your email address will not be published. Required fields are marked *

*

captcha

Please enter the CAPTCHA text

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>