Take the 2-minute tour ×

I am using the Dungeons application example and I am using the BillingService class provided in that example.

I am using Java 6 and @override works for me, but I get a compile error on these two methods inside BillingService.java:

 * This is called when we are connected to the MarketBillingService.
 * This runs in the main UI thread.
public void onServiceConnected(ComponentName name, IBinder service) {
    if (Consts.DEBUG) {
        Log.d(TAG, "Billing service connected");
    mService = IMarketBillingService.Stub.asInterface(service);

 * This is called when we are disconnected from the MarketBillingService.
public void onServiceDisconnected(ComponentName name) {
    Log.w(TAG, "Billing service disconnected");
    mService = null;

Would someone help me understand why this is happening?


share|improve this question
what are the errors? –  Ran Jul 17 '12 at 6:38
What are the Errors you facing? can you specify that? –  Bhavesh Patadiya Jul 17 '12 at 7:18
@Ran and Bhavesh the COMPILE time error that happens is I leave override here is this: Multiple markers at this line - The method onServiceConnected(ComponentName, IBinder) of type BillingService must override a superclass method –  Genadinik Jul 17 '12 at 10:48
Could you check if you're compiling under Java 1.5 or lower? If so please change to 1.6+… –  user1521536 Jul 21 '12 at 16:03
I had the same problem and it worked for me to change to Java 1.6 from 1.5. –  harrakiss May 30 '13 at 17:54

6 Answers 6

up vote 3 down vote accepted

I think you should simply remove the @Override decorator from both methods. I'm using the Google BillingService class and this is my method:

public void onServiceConnected(ComponentName name, IBinder service)
    mService = IMarketBillingService.Stub.asInterface(service);

You are implementing an interface, not extending a class with abstract methods.

share|improve this answer
thanks, could you just help me understand a bit more what is the difference between having the override or commenting it out? –  Genadinik Jul 23 '12 at 12:01
Sure, when you are implementing an interface, you don't use the override key word. If, however, you are extending an abstract class or a class with some abstract methods, then you use the override key word. Overriding method behaviour is one of the ways of implementing polymorphism: you could have several classes which override methods in an abstract base class but each of these classes could do something different e.g. you might have a class which will sort integers and another which would sort decimals - they could both override the sort() method in an abstract base class. –  John J Smith Jul 23 '12 at 13:51

Make sure your class implements the ServiceConnection interface.

share|improve this answer
yes, it already implements that interface. But those error are still there. –  Genadinik Jul 17 '12 at 12:35
"multiple markers" could mean there are several errors on that line, so check what they are. –  Ran Jul 17 '12 at 12:38
these are the two errors: Multiple markers at this line - The method onServiceDisconnected(ComponentName) of type BillingService must override a superclass method ....and - implements android.content.ServiceConnection.onServiceDisconnected –  Genadinik Jul 17 '12 at 13:02
did you try running Android lint on it? sometimes it helps. –  Ran Jul 17 '12 at 13:30
I am actually not familiar with Android lint. I looked it up..sounds useful, but I had not set it up yet. –  Genadinik Jul 17 '12 at 14:40

In App billing is a challenge to get started with. The trick is to get it started in a independent project and then do all your specific feature. Trust me on this, and done be brave and do it all together, its not worth the time it takes to get started. I hope google improves on in app billing overall, to make it easy to implement, understand and debug. I had blogged about it a while back and created a helloworld kinda project for people to download and get working. I hope it helps you too.

Debug Android inapp billing using Eclipse

share|improve this answer
I agree, but I happen to be almost there, and just have a few bugs to work out. –  Genadinik Jul 17 '12 at 10:30
This in app billing thingy used up a lot of my energy. Especially since every little change has to be tested in more than 1 combination. You miss one step and a reinstall of your app, and your customer may loose all purchased information. Its crazy. Testing every scenario (no matter how simple it is) takes 1/2 hour. Thats why I like to start from a simple HelloWorld. –  Siddharth Jul 18 '12 at 2:32

You might try to use default compile options.

Right-click (or Control-Click) the project and select "Properties"

Select "Java Compiler"

Uncheck "Enable Project Specific Settings"

Eclipse will prompt to re-compile and it should be all good.

share|improve this answer

Install your app Signed ...so go to android tools export signed application .... now that its signed you can get back queries. This was my issue at least on a physical device.

share|improve this answer

Right click on the Project Select --> Android Tools Select --> Fix Project Properties

This fixed it for me (I believe it was a Java compiler setting throwing it off).

share|improve this answer

Your Answer


