如何将aidl文件添加到Android工作室(来自应用内计

how can I add the aidl file to Android studio (from the in-app billing example)(如何将aidl文件添加到Android工作室(来自应用内计费示例))
本文介绍了如何将aidl文件添加到Android工作室(来自应用内计费示例)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在将 Eclipse 应用程序迁移到 Android Studio.此应用正在使用应用内计费.

我的主要问题是编译项目和aidl文件(我猜你们都使用

  • http://developer.android.com/guide/components/aidl.html
  • 解决方案

    正如错误信息所说,您需要将 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/.

    这篇关于如何将aidl文件添加到Android工作室(来自应用内计费示例)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

    本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

    相关文档推荐

    How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
    Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
    How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
    How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
    Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
    Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)