title: aidl file couldnt find import for class with Android.mk
body: <p>I have a project that uses AIDL interfaces and everything is building just fine in android studio with gradle. however, im only using android studio for the convenience of an IDE for developing my android applications, i have to actually use Android make files to build my applications with the rest of the AOSP tree.</p>
  
  <p>when i started this project i just had one small aidl file as a proof of concept and it built fine in both AS and android make. but when i started adding more aidl files it just broke with the error: </p>
  
  <pre><code>[ 14% 1/7] Aidl: myradioservice&lt;= vendor/apps/radioservice/myRadioService/aidl/com/foo/myradioservice/IMetadataCallback.aidl
  FAILED: out/target/common/obj/APPS/myRadioService_intermediates/aidl/com/foo/myradioservice/IMetadataCallback.java
  vendor/apps/radioservice/myRadioService/aidl/com/foo/myradioservice/IMetadataCallback.aidl:4: couldn't find import for class com.foo.myradioservice.MyMetaData
  [ 28% 2/7] Aidl: myradioservice &lt;= vendor/apps/radioservice/myRadioService/foo/com/foo/myradioservice/IMyRadioManager.aidl
  FAILED: out/target/common/obj/APPS/myRadioService_intermediates/aidl/com/harman/myradioservice/IMyRadioManager.java
  vendor/apps/radioservice/myRadioService/aidl/com/foo/myradioservice/IMyRadioManager.aidl:4: couldn't find import for class com.foo.myradioservice.IMetadataCallback
  </code></pre>
  
  <p>here are my aidl files:</p>
  
  <p>IMetadataCallback.aidl</p>
  
  <pre><code>package com.foo.myradioservice;
  
  import com.foo.myradioservice.MyMetaData;
  
  interface IMetadataCallback {
  
      void onMetadataChange(out MyMetaData metadata);
  
  }
  </code></pre>
  
  <p>IMyManager.aidl</p>
  
  <pre><code>package com.foo.myradioservice;
  
  import com.foo.myradioservice.IMetadataCallback;
  
  interface IMyManager {
  
      void tune(int channelNumber);
  
      void registerMetadataListener(IMetadataCallback cb);
  
      void unregisterMetadataListener(IMetadataCallback cb);
  }
  </code></pre>
  
  <p>MyMetadata.aidl</p>
  
  <pre><code>package com.foo.myradioservice;
  
  parcelable MyMetaData;
  </code></pre>
  
  <p>(I also have a MyMetadata.java file that implements Parcelable in the java source directory.)</p>
  
  <p>and here is my android make file</p>
  
  <pre><code>LOCAL_PATH:= $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_PACKAGE_NAME := myRadioService
  
  LOCAL_AIDL_INCLUDES := $(call all-Iaidl-files-under, aidl)
  LOCAL_SRC_FILES := $(call all-java-files-under, java) $(call all-Iaidl-files-under, aidl)
  
  LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
  
  LOCAL_AAPT_FLAGS := --auto-add-overlay
  
  LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
  LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res
  
  LOCAL_JAVA_LIBRARIES := android.car
  
  LOCAL_PROGUARD_ENABLED := disabled
  
  LOCAL_DEX_PREOPT := false
  
  include $(BUILD_PACKAGE)
  </code></pre>
  
  <p>Things ive tried:</p>
  
  <ul>
  <li>moving all aidl files into the java directory with the rest of the
  code, ive seen this done in other places.</li>
  <li>creating a separate module that compiles the aidl files and including
  that into my service, also have seen this done in other places.</li>
  <li>moving the parcelable java code into the aidl directory</li>
  <li>stubbing out all implementations of the interfaces</li>
  <li>changing my aidl includes macro to: LOCAL_AIDL_INCLUDES :=
  $(LOCAL_PATH)/aidl as suggested in another SO answer</li>
  <li>all sorts of combinations of changes to the LOCAL_SRC_FILES and LOCAL_AIDL_INCLUDES, even using absolute paths to the files</li>
  </ul>