应用内结算 - 生成的IInAppBillingService.java出错

nmw*_*223 2 android in-app-billing

尝试首次使用应用内结算V3,使用Eclipse定位到Android 2.2(API级别8).

创建了一个名为com.android.vending.billing的包(在/ src中),删除(导入)了IInAppBillingService.aidl.但/ gen现在包含构建错误,例如

@Override public int isBillingSupported(int apiVersion, java.lang.String packageName, java.lang.String type) throws android.os.RemoteException
Run Code Online (Sandbox Code Playgroud)

它说"IInAppBillingService.Stub.Proxy类型的方法isBillingSupported(int,String,String)必须覆盖超类方法......".

它建议我删除@override但这是谷歌提供的文件,我不想更改它.出了什么问题?

清洁和重建没有帮助.

Rag*_*ood 13

如果您使用的是Java 5,则会出现此错误.Java 5在@Override注释方面存在一些问题.

您需要确保安装了Java 6,然后您可以通过转到Project -> Properties -> Java Compiler并选中Enable project specific settings框并将Compiler compliance level:值更改为更改来更改用于构建的版本1.6

Android工具与Java 7不兼容,所以不要使用1.7.