title: Is it possible to add a prebuilt APK to an AOSP build as an user app?
body: <p>I am looking to add a prebuilt APK to my AOSP build. I can already do this by doing the following:</p>
  
  <ol>
  <li>Add the APK to the <em>$root_of_my_source_tree/packages/apps</em> folder.</li>
  <li><p>Create an <em>Android.mk</em> file. The file has the following contents:</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE_TAGS := optional
  
  LOCAL_MODULE := &lt;name of APK&gt;
  
  LOCAL_SRC_FILES := &lt;Name of APK&gt;.apk
  
  LOCAL_MODULE_CLASS := APPS
  
  LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
  
  LOCAL_CERTIFICATE := platform
  
  include $(BUILD_PREBUILT)
  </code></pre></li>
  <li><p>Add:</p>
  
  <pre><code>PRODUCT_PACKAGES += \ &lt;name of APK&gt;
  </code></pre>
  
  <p>To a make file that gets picked up by the AOSP build system.</p></li>
  </ol>
  
  <p>This adds the APK to the <em>/system/app</em> folder which is read-only so the user will not be able to update the APK. I would like the APK to be placed in the <em>/data/app</em> folder so the user can actually update the prebuilt APK.</p>
  
  <p>I have tried the suggestions in <a href="https://stackoverflow.com/questions/10579827/how-do-i-add-apks-in-an-aosp-build">this</a> question and they did not work. I tried the suggestion in <a href="https://stackoverflow.com/questions/11984572/install-an-app-into-data-app-instead-of-system-app-in-the-android-source-compil">this</a> question and while it did output the APK to the <em>/data/app</em> folder of the finished build, once I flashed the image onto my device, the app was not there. The second answer in that question does provide a possible explanation for this but no other suggestions. </p>
  
  <p>Ultimately, I need an APK preloaded in my build that can be updated so if this doesn't work or is a bad approach, I am open to suggestions.</p>