Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio does not detect .aidl files

I have found a sample from the Internet (https://github.com/manishkpr/Android-AIDL-Example) and ran on Android Studio and it worked fine.

But now when I am trying to recreate the project, the Android Studio fails to recognize the .aidl file no matter where I place it. Can anybody tell me what is the right location to place .aidl files in Android Studio?

p.s. I have added the below code to build.gradle and place the .aidl file in the java directory, but failed to get it work.

sourceSets {
main {
    aidl.srcDirs = ['src/main/java']
}
like image 496
Code_Yoga Avatar asked Aug 30 '13 11:08

Code_Yoga


People also ask

What is AIDL files in Android?

An AIDL file is used by Android app developers to enable communication between different apps. It contains Java source code that defines an interface, or contract, for how apps can communicate with each other. AIDL is an implementation of the Interprocess Communication (IPC) protocol provided by Android.

Why we use AIDL in Android?

The Android Interface Definition Language (AIDL) is similar to other IDLs you might have worked with. It allows you to define the programming interface that both the client and service agree upon in order to communicate with each other using interprocess communication (IPC).

When to use AIDL?

You need to use AIDL if you want a class outside of your application's process to access the Service. If you're only using the service from inside your application, you can use a local service.


2 Answers

The below link solved my issue.

https://code.google.com/p/android/issues/detail?id=56160

like image 133
Code_Yoga Avatar answered Oct 21 '22 05:10

Code_Yoga


In my case Clean and Rebuild project solved my problem.
Hope this helpful.

like image 42
Naruto Uzumaki Avatar answered Oct 21 '22 05:10

Naruto Uzumaki