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

  • Home
  • SEARCH
  • 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 8770251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:31:30+00:00 2026-06-13T17:31:30+00:00

I’ve built the Assimp library as a shared library. I’ve included it in my

  • 0

I’ve built the Assimp library as a shared library. I’ve included it in my Android ndk project and it builds fine but when I load it I get the following error:
Unable to load native library: My-Native-Activity.

(Perhaps I should add that my activity works fine when the library is not included and that I’ve checked the apk and on the device; the library is being added to the libs folder and installed on the device in /data/data/my-app/lib.)

I’ve done a lot of reading and it seems that the only way to solve this is to load them using System.loadLibrary before launching my native activity. I think I’d prefer load them dynamically using dlopen before taking that approach.

Am I correct in assuming that Android wont automatically load the shared libraries my native activity(i.e. my shared library) depends on?

I would build it as a static library but it was over 54Mb which wont work.

This is my Android.mk:
I’ve tried adding -lassimp to LOCAL_LDLIBS. I’m not sure if that would be correct but it didn’t make any difference.

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE                        := assimp
LOCAL_SRC_FILES                     := libassimp.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE                        := native-activity
LOCAL_SRC_FILES                     := main.cpp 
LOCAL_LDLIBS                        := -llog -landroid -lEGL -lGLESv2 
LOCAL_STATIC_LIBRARIES              := android_native_app_glue
LOCAL_SHARED_LIBRARIES              := assimp
LOCAL_CPPFLAGS                      += -march=armv7-a -mfloat-abi=softfp
LOCAL_CFLAGS                := $(LOCAL_CPPFLAGS)
TARGET_ARCH_ABI                     := armeabi-v7a
LOCAL_C_INCLUDES            += $(LOCAL_PATH)
include $(BUILD_SHARED_LIBRARY)

$(call import-module,android/native_app_glue)
  • 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-13T17:31:31+00:00Added an answer on June 13, 2026 at 5:31 pm

    Subclassing android.app.NativeActivity is the simplest way to solve this problem.

    package com.you;
    
    public class MyNativeActivity extends android.app.NativeActivity {
    
        static {
           System.loadLibrary("assimp");
        }
     }
    

    Then change your AndroidManifest.xml. Replace android.app.NativeActivity with MyNativeActivity and remove the tag hasCode="false".

    As a side note, Android does search for dependencies when loading a shared library. But the scope of the search is limited to /system/lib.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to construct a data frame in an Rcpp function, but when I
I need to clean up various Word 'smart' characters in user input, including but

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.