Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7602959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:32:46+00:00 2026-05-30T23:32:46+00:00

I have an android application which uses jni and I’m trying to automate build

  • 0

I have an android application which uses jni and I’m trying to automate build process in Eclipse (using cdt plugin). I need to build my own static library, and I also need to use some precompiled libraries.
That means that I need to
a) build my own shared library (no problems here)
b) after build is complete, copy existing libraries into libs/armeabi folder (because this folder will be cleared during build process I must copy those files after every build)

I have some problems with b). What I’m trying to do is I’m inserting custom shell script (which works when executed as-is) after include $(BUILD_SHARED_LIBRARY) in Android.mk file. Unfortunately, this doesn’t work, because apparently /libs/armeabi folder gets cleared only after Android.mk file is complete.

Is that true? Is there a way to insert post-build script into Android.mk? Is there any way I can execute bash script after jni code finished building but before whole build is complete (e.g. before java part is build and application starts executing?)? I though there must be some kind of “post-build” script in eclipse c/c++ project build settings, but there is no such thing.

Here’s the complete Android.mk file:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_LDLIBS := -llog

LOCAL_C_INCLUDES += $(LOCAL_PATH)

LOCAL_MODULE    := player
LOCAL_SRC_FILES := player.c

include $(BUILD_SHARED_LIBRARY)

$(shell ./copy-libs.sh) #this script will get called, but the files will be erased right after
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:32:47+00:00Added an answer on May 30, 2026 at 11:32 pm

    Well, it looks like there is an easier way to copy .so and .a libs without resorting to custom build scripts.
    NDK supports prebuilt modules starting from ndk-r5, and they allow to copy .a or .so libraries into obj/lib folder during build process as needed.

    Example and complete description are available in PREBUILTS.html file inside $NDK_INSTALLATION_FOLDER/docs/.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In eclipse workset I have an android library and an application which uses this
I have developed an Android application using Eclipse which works perfectly on the Android
I have an Android Application which uses JNI calls. Now i want this application
I have a Android Application which is basically uses WebView for all interaction.. How
I have a problem with my android application. That application which uses the kSOAP
I'm developing an Android 3.1 Tablet application which uses SQLite 3. I have these
I have developed a android application using phonegap. I have registered certain recievers which
I have written an Android application that uses SQLite database which is saved in
I have an Android application which uses C2DM services (aka push). I have a
I have developed an android application, which uses image files and strings from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.