AIDL files not building in Eclipse in random projects?

后端 未结 3 2034
遇见更好的自我
遇见更好的自我 2021-01-28 19:31

I\'ve got some AIDL files which I want to include in a project, however Eclipse seems to work differently on different projects.

I\'m developing an SDK for an applicatio

相关标签:
3条回答
  • 2021-01-28 20:08

    Okay, I don't understand this but for some reason 12.04 of ubuntu flagged up an error.

    On one project I could called the file IAPPNAMEConect.aidl but the other wanted it as IAPPNAMEService.aidl

    I completely forgot about Java's strictness there

    0 讨论(0)
  • 2021-01-28 20:16

    I had this exact issue happen to me today. It turns out this happens when there are source folders in your project that do not actually exist.

    So verify in your project Java Build Path that all source folders actually exist. After removing a dead source folder link from there my project once again compiled the aidl.

    0 讨论(0)
  • 2021-01-28 20:22

    From my experience you create the .aidl file in your project (make sure your included packages are correct - you will get an error if not). If the .aidl file is good a .java file will be created in the gen/ directory under the correct package name.

    Next you must connect your java code to the interface using

    <YourAidlClassName>.Stub myAidlInterface = new <YouAidlClassName>.Stub() {
    
        // Your AIDL interface methods will appear in here and can now be used
        // in your application as myAidlInterface.methodName();
    }
    

    Hope this helps.

    0 讨论(0)
提交回复
热议问题