我怎么能AIDL文件添加到Android工作室(从应用内结算为例) [英] how can I add the aidl file to Android studio (from the in-app billing example)

查看:1314
本文介绍了我怎么能AIDL文件添加到Android工作室(从应用内结算为例)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在迁移一个Eclipse的应用程序到Android工作室。 这个程序是在应用程序内结算使用。

我的主要问题是编译项目和AIDL文件(我想你都使用<一个href="http://stuff.mit.edu:8001/afs/sipb.mit.edu/project/android/sdk/android-sdk-linux/extras/google/play_billing/IInAppBillingService.aidl">this文件)

我收到此错误信息:

 摇篮:错误:找不到符号类IInAppBillingService
摇篮:错误:包IInAppBillingService不存在
 

所以,下面的一些教程,我将这个文件从com.mypackage.billing为src /主/ AIDL (见这个参考

但只要,因为我这样做,我得到这个消息:

  

摇篮:执行失败的任务:XXXXXXXXXXX:compileDebugAidl。

     
    

无法运行命令:             (...)C:\用户\ XXXX \ AndroidStudioProjects \ xxxxxxProject \ XXXXXXX的\ src \主\ AIDL \ IInAppBillingService.aidl:45     接口IInAppBillingService应该在一个名为声明     COM \ XXXXXXXX \开票\ IInAppBillingService.aidl。

  

该消息显然是来自谷歌的错误页面我上面链接后一对矛盾。

任何suceeded使这个AIDL文件中工作,可以帮助我吗?

只是为了告知,一些链接我也跟着:

  • <一个href="http://tools.android.com/tech-docs/new-build-system/user-guide">http://tools.android.com/tech-docs/new-build-system/user-guide
  • <一个href="http://developer.android.com/guide/components/aidl.html">http://developer.android.com/guide/components/aidl.html
解决方案

正如错误消息说,你需要把 IInAppBillingService.aidl 通过决定正确的目录它的封装(com.android.vending.billing)。

的src /主/ AIDL / 文件夹,你已经有了,把 .aidl 文件中的 COM /安卓/自动售货机/计费/

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:\Users\xxxx\AndroidStudioProjects\xxxxxxProject\xxxxxxx\src\main\aidl\IInAppBillingService.aidl:45 interface IInAppBillingService should be declared in a file called com\xxxxxxxx\billing\IInAppBillingService.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:

解决方案

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/.

这篇关于我怎么能AIDL文件添加到Android工作室(从应用内结算为例)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆