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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:54:20+00:00 2026-05-31T22:54:20+00:00

Consider the following situation: I have two android projects named P1 and P2 which

  • 0

Consider the following situation: I have two android projects named P1 and P2 which both produce an apk which use the same process-id and will run in the same process on android.
P1 and P2 both use Java library JL1. JL1 loads at runtime shared library1 SL1.

What I see runtime is that at some point I get a java/lang/UnsatisfiedLinkError while loading this SL1.
It also outputs: Shared lib already opened.

What causes this problem? I’m assuming that library code in java is sort of copied in every project/apk and at runtime when apks are merged in one process it forgets about the copies. So every copy loads its shared library itself, causing the already loaded error.

If so, isn’t this unwanted behaviour. Because, now you can never have a java library with an shared library in the same process used more than once.

[edit] I found out that every apk uses its own class loader (also when in the same process). This means that every JL will be class loaded per apk and therefore every shared object will be loaded more than once, resulting in an error. Somebody any ideas how to get around this? Is it possible to let apks share a classloader?

  • 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-31T22:54:21+00:00Added an answer on May 31, 2026 at 10:54 pm

    Every apk has its own class loader. This means that two projects/apks will have there own copy of classes from the library. Which they load at runtime. Therefore what looks like the same classes are actually copies. Therefore loading a native library in such a class will result in loading it for every loaded class (even if this is done in the static field). Which results in a runtime error for loading the native shared object more than once if the two apks share the same process.

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

Sidebar

Related Questions

Consider the following situation: We have two Localizable.string files, one in en.lproj and one
Consider the following common situation: You have some MainView in your Cocoa application, loaded
Consider the following situation. I have 3 tables in a resource planning project(created using
So, please consider the following situation I have a super class of type Shapes
Consider I have the following situation: I have a branch br_foo from revision 4.
Consider the following situation. I've 2 types of backgrounds: 1.Photoshop gradients for which I
Consider the following situation where I have a list of n matrices (this is
Consider the following situation Code was added to the trunk at revision x A
Consider the following situation: WidgetCompany produced a .NET DLL in 2006 called Widget.dll, version
Consider following scenario: I have RESTful URL /articles that returns list of articles user

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.