title: Android.bp and ninja: error: unknown target
body: <p>I have an application in <code>packages/apps</code> under my vendor dir in Android O.
  The application relies on a HIDL interface, which is added as a java library.</p>
  
  <p>If I build the app with <code>Android.mk</code> file, it builds just fine.
  If I build the app with <code>Android.bp</code> file, hiding the <code>Android.mk</code>, it doesn't build and fails with an error:</p>
  
  <blockquote>
    <p>ninja: error: unknown target 'MODULES-IN-vendor-${vendor_name}-apps-${app_name}', did you mean 'MODULES-IN-vendor-${vendor_name}-apps-${another_app_name}'?</p>
  </blockquote>
  
  <p>Or it can be just</p>
  
  <blockquote>
    <p>ninja: error: unknown target 'MODULES-IN-vendor-${vendor_name}-apps-${app_name}'</p>
  </blockquote>
  
  <p>My <code>Android.bp</code> looks like:</p>
  
  <pre><code>android_app {
  
      java_libs: ["some.hidl.lib-V1.0-java"],
  
      java_static_libs: ["android.hidl.base-V1.0-java-static"],
  
      srcs: ["**/*.java"],
  
      android_resource_dirs: ["res/**"],
  
      name: "MyApplication",
  
      module_name: "MyApplication",
  
      package_name: "me.myself.MyApplication", // also tried just the name as it is done in Android.mk
  
      enabled: true,
  
      proguard_enabled: disabled
  
  }
  </code></pre>
  
  <p>Any ideas?</p>