title: how to include prebuilt shared libraries in apk with eclipse
body: <p>I have a shared library libfoo.so and need to use it in my android app.</p>
  
  <p>My first try was to have in Android.mk:</p>
  
  <pre><code>include $(CLEAR_VARS)
  LOCAL_MODULE := test
  LOCAL_SRC_FILES := test.cpp
  LOCAL_LDLIBS := -L$(PATH_TO_FOO) -lfoo
  include $(BUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>in my activity, I have:</p>
  
  <pre><code>statis
  {
      System.loadLibrary("foo");
  }
  </code></pre>
  
  <p>This builds correctly, however I noticed that created apk doesnt include libfoo.so (also I see it is not copied to libs/armeabi). I guess for that reason I have UnsatisfiedLinkError when executing my app.</p>
  
  <p>I saw in some other posts that I need to add $(PREBUILD_SHARED_LIBRARY), so I add the following to my Android.mk:</p>
  
  <pre><code>include $(CLEAR_VARS)
  LOCAL_MODULE:= foo
  LOCAL_SRC_FILES := $(FOO_PATH)/libfoo.so
  include $(PREBUILD_SHARED_LIBRARY)
  </code></pre>
  
  <p>But now I am getting the build error:</p>
  
  <pre><code>foo: LOCAL_SRC_FILES points to a missing file.
  </code></pre>
  
  <p>I am sure that the path is correct. Note that the libfoo.so was having origionally the version number at the end, though I had to remove it (and leave only .so) since ndk-build complained.</p>
  
  <p>What am I doing wrong?</p>