title: Android Aidl Compile Error: couldn't find import for class
body: <p>(<em>I know there're multiple questions on stackoverflow and elsewhere (like google group) about adding parcelable for NetworkInfo but this is not about that.</em>)</p>
  
  <p>My work is under $(AOSP_ROOT)/device/ and involves multiple <strong>aidl</strong> files. one of it is like,</p>
  
  <pre><code>package com.example;
  
  parcelable SomeRequest;
  </code></pre>
  
  <p>And another aidl is like,</p>
  
  <pre><code>package com.example;
  
  import com.example.SomeRequest;
  interface SomeService {
      SomeRequest getRequest();
  }
  </code></pre>
  
  <p>And I'll get compile errors like,</p>
  
  <pre><code>device/somedevice/sdk/libs/aidl/com/example/SomeService.aidl:9: couldn't find import for class com.example.SomeRequest
  </code></pre>
  
  <p>I'm wondering it is the order of processing aidl files. My Android.mk looks like,</p>
  
  <pre><code>LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, aidl)
  LOCAL_AIDL_INCLUDES := $(call all-Iaidl-files-under, aidl)
  </code></pre>
  
  <p>This build error is introduced after I moved aidl files from src/ folder to aidl/ folder (for some reason I have to do so). It worked before but now even if I moved it back to src/ folder it doesn't work anymore. I tried to clean up $(AOSP_ROOT)/out/device/target but it's not helping.</p>
  
  <p>Ideas?</p>