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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:12:59+00:00 2026-06-04T17:12:59+00:00

I have an application which uses native libraries for various targets – ARMv6, ARMv6+vfp,

  • 0

I have an application which uses native libraries for various targets – ARMv6, ARMv6+vfp, ARM7+vfp, ARM7+Neon, ARM7 + Tegra as well as some universal libraries. My goal is to pack all the libraries into one .apk file so that I don’t have to distribute separate builds – I don’t care a much about the total .apk size.

Here is my Android.mk script – just an example but with enough info:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
TARGET_ARCH_ABI := armeabi
LOCAL_MODULE := prebuilt_arm_v6vfp
LOCAL_SRC_FILES := ../bin/libplayer_v6vfp.so
LOCAL_EXPORT_LDLIBS := ../libplayer_v6vfp.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
TARGET_ARCH_ABI := armeabi-v7a
LOCAL_MODULE := prebuilt_arm_v7n
LOCAL_SRC_FILES := ../bin/libplayer_v7n.so
LOCAL_EXPORT_LDLIBS := ../libplayer_v7n.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := player

LOCAL_SRC_FILES := some_cpp_sources...

LOCAL_LDFLAGS := -L$(LOCAL_PATH)/../bin
LOCAL_LDLIBS := -llog -lz -lm -lplayer_v7n -lplayer_v6vfp
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true

include $(BUILD_SHARED_LIBRARY)

Now I have the following problem – it creates libs folder with armeabi and armeabi-v7a subfolders – that’s OK. But the content of both subfolders is the same, both contains libplayer_v7n.so and libplayer_v6vfp.so as well.

How can I assure each subfolder contains only a correct version of native library according to its eabi version?

EDIT 1:

As you can see, I link libplayer.so with both shared libraries, they have compatible interfaces. I wanted to select the correct library dynamically when loading in my Java wrapper after detecting the CPU type. But it seems it is not possible. Any idea how to choose the correct library dynamically? There must be a solution for such a common case.

EDIT 2:

It seems I can link my libplayer.so only with one library and have to select its correct version at runtime. But now the problem is how to store six native libraries of various versions but with the same name in the lib folder. Subfolders seem to be an obvious solution, but I am not sure it is possible. The other solution would be to deploy the correct library via the separate .apk as a plug-in, but that’s exactly I want to avoid..

  • 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-04T17:13:00+00:00Added an answer on June 4, 2026 at 5:13 pm

    Then do the following:

    1. name architecture specific libraries with same name (for example: libplayer_arch.so) & put them in different directories.
    2. link libplayer.so to libplayer_arch.so
    3. write your Java code like this:

    .

    if (isArmv7())
    {
        System.loadLibrary("armv7/libplayer_arch.so");
    }
    else
    {
        System.loadLibrary("armv6/libplayer_arch.so");
    }
    System.loadLibrary("libplayer.so");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I have an application written in native C++ which uses the wxWidgets toolkit's
I have a java application which uses JNI in some parts to do some
I have a Java application which uses the native LAF like so: UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); This
I have an application which uses four databases in different geographical locations. All the
I have an application which uses hotkeys which are to be defined by the
I have an application which uses libuv library. it runs default loop: uv_run(uv_default_loop()); How
I have an application which uses the Word and Excel interop references. I have
I have an application which uses JSPs and Servlets and deployed on IBM-WASCE 2.1.
Possible Duplicate: How to detect true Windows version I have an application which uses
I have this android application which uses java-javascript bridge to pick up information from

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.