問題描述
我目前正在將 Eclipse 應(yīng)用程序遷移到 Android Studio.此應(yīng)用正在使用應(yīng)用內(nèi)計費.
我的主要問題是編譯項目和aidl文件(我猜你們都使用
正如錯誤信息所說,您需要將 IInAppBillingService.aidl
放在它的包指定的正確目錄中(com.android.vending.billing).
在您已有的 src/main/aidl/
文件夾中,將 .aidl
文件放入 com/android/vending/billing/
.
I am currently migrating an Eclipse app to Android Studio. This app was using the in app billing.
My main problem is to compile the project and the aidl file (I guess you all use this file)
I get this error message:
Gradle: error: cannot find symbol class IInAppBillingService
Gradle: error: package IInAppBillingService does not exist
So, following some tutorials, I move this file from com.mypackage.billing to src/main/aidl (see this reference)
But as soon, as I do that, I get this message:
Gradle: Execution failed for task ':xxxxxxxxxxx:compileDebugAidl'.
Failed to run command: (...) C:UsersxxxxAndroidStudioProjectsxxxxxxProjectxxxxxxxsrcmainaidlIInAppBillingService.aidl:45 interface IInAppBillingService should be declared in a file called comxxxxxxxxillingIInAppBillingService.aidl.
The message is clearly a contradiction with the post from the Google bug page I linked above.
Anyone suceeded to make this aidl file to work and can help me?
Just to inform, some links I followed:
- http://tools.android.com/tech-docs/new-build-system/user-guide
- http://developer.android.com/guide/components/aidl.html
Just as the error message says, you need to put IInAppBillingService.aidl
in the correct directory dictated by it's package (com.android.vending.billing).
Within the src/main/aidl/
folder you already have, put the .aidl
file in com/android/vending/billing/
.
這篇關(guān)于如何將aidl文件添加到Android工作室(來自應(yīng)用內(nèi)計費示例)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!