Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
121 views
in Technique[技术] by (71.8m points)

android - 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 comandroidvendingillingIInAppBillingService.aidl.

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

Has anybody seen that before?

question from:https://stackoverflow.com/questions/13927759/error-in-adding-the-in-app-billing-library

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...