title: Correct way to add .so library to Android 10 build
body: <p>I've made a couple attempts to add a single shared object library to an Android 10 build by adapting older instructions <a href="https://stackoverflow.com/questions/29180118/use-prebuilt-shared-library-in-android-aosp">here</a> and <a href="https://saurabhsharma123k.blogspot.com/2017/01/add-so-file-in-android-aosp-source-code.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I added a directory containing the library under /device/vendor/name/ and an Android.mk file using the two-target example.</p>
  
  <p>They have all lead back to the same error:
  <code>build/make/core/base_rules.mk:480: error: writing to readonly directory: "system/lib64/libjni_latinimegoogle.so"</code></p>
  
  <p>Is there a correct/accepted way to do this for 10? Thanks</p>
  
  <p>edit: Android.mk file contents</p>
  
  <pre><code>LOCAL_PATH := $(call my-dir)
  include $(CLEAR_VARS)
  LOCAL_MODULE := libjni_latinimegoogle
  LOCAL_MODULE_SUFFIX := .so
  LOCAL_MODULE_CLASS := SHARED_LIBRARIES
  LOCAL_MODULE_TAGS := optional
  LOCAL_PRELINK_MODULE := false
  ifdef TARGET_2ND_ARCH
  LOCAL_MULTILIB := both
  LOCAL_MODULE_PATH_64 := system/lib64
  LOCAL_SRC_FILES_64 := system/lib64/libjni_latinimegoogle.so
  LOCAL_MODULE_PATH_32 := system/lib
  LOCAL_SRC_FILES_32 := system/lib/libjni_latinimegoogle.so
  else
  LOCAL_MODULE_PATH := system/lib64
  LOCAL_SRC_FILES := system/lib64/libjni_latinimegoogle.so
  endif
  include $(BUILD_PREBUILT)
  </code></pre>