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 8996433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:45:15+00:00 2026-06-15T23:45:15+00:00

I almost found the answer in Adding a external jar reference in Android.mk but

  • 0

I almost found the answer in Adding a external jar reference in Android.mk but I’m still not quite there.

My project contains commons-io-2.4.jar and jsch-0.1.49.jar in the libs/ directory. Everything builds beautifully in eclipse. Now I want to write an Android.mk file to build my project automatically.

My Android.mk looks like this, but it’s not working.

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := MyProject
LOCAL_CERTIFICATE := platform

LOCAL_STATIC_JAVA_LIBRARIES := jsch-0.1.49 commons-io-2.4

LOCAL_PROGUARD_FLAGS      := -include $(LOCAL_PATH)/proguard.flags

include $(BUILD_PACKAGE)

LOCAL_STATIC_JAVA_LIBRARIES := libs
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libs:jsch-0.1.49 libs:commons-io-2.4

include $(BUILD_MULTI_PREBUILT)

I’m sure there’s just a little secret sauce I’ve gotten wrong, but I can’t figure it out.

Is there a good reference for Android.mk files? All I could find were recipes for working with the ndk.

  • 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-06-15T23:45:16+00:00Added an answer on June 15, 2026 at 11:45 pm

    OK, a couple hours of googling and experimenting seems to have found the solution.
    Documenting it here for others to find:

    The key was to

    1. Define LOCAL_STATIC_JAVA_LIBRARIES with a symbolic name for the library I want to include, e.g. libjsch
    2. Execute CLEAR_VARS (why?)
    3. Define LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES as libjsch:<path-to-jar-file>
    4. Include BUILD_MULTI_PREBUILT.

    (Testing showed that any symbolic name (e.g. “foo”) works fine, as long as it matches in the two declarations.)

    LOCAL_PATH:= $(call my-dir)
    include $(CLEAR_VARS)
    
    LOCAL_SRC_FILES := $(call all-java-files-under, src)
    
    LOCAL_PACKAGE_NAME := MyProject
    
    LOCAL_STATIC_JAVA_LIBRARIES := libjsch
    
    include $(BUILD_PACKAGE)
    
    include $(CLEAR_VARS)
    
    LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libjsch:libs/jsch-0.1.49.jar
    
    include $(BUILD_MULTI_PREBUILT)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for stupid question, but I have not found a good answer anywhere. if
I've looked through stackoverflow for an answer and am almost there but need some
I found this answer and it sounds like almost exactly what I'm doing. I
I found an answer that almost solves my problem: https://stackoverflow.com/a/5717191/1065546 This answer demonstrates how
I almost found the answer to this question in this thread (samplebias's answer); however
I'm almost certain this is going to be a very simple answer but I
There are other questions about this but I didn't find a clear answer. With
OK, so iv almost completed my program for my project but I cant get
I have been exploring different answers about release management in Mercurial and almost found
Update : I found almost exact similar question , yet it has slightly different

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.