LIBRARY_PATH is error #2

Open
killme2008 opened this Issue Oct 21, 2011 · 5 comments

Comments

Projects
None yet
3 participants
@killme2008

LIBRARY_PATH should be

private static String LIBRARY_PATH = "/data/data/" + PACKAGE_NAME + "/lib";

It is not in app folder on my i9100.

@paddybyers

This comment has been minimized.

Show comment
Hide comment
@paddybyers

paddybyers Oct 22, 2011

Owner

I agree lib is the right place - but that's only OK if you can persuade Android to extract the library there automatically on installation. I'm not sure how you do this - for me it was working sometimes but not always.

So I put the lib in app, and have code there to programmatically extract it when it is first loaded. You can't do this in lib because the lib directory is owned by root and not by the app, and you can't put things in there programmatically.

If you can figure out why it's not always being extracted to lib automatically, then great.

Thanks

Owner

paddybyers commented Oct 22, 2011

I agree lib is the right place - but that's only OK if you can persuade Android to extract the library there automatically on installation. I'm not sure how you do this - for me it was working sometimes but not always.

So I put the lib in app, and have code there to programmatically extract it when it is first loaded. You can't do this in lib because the lib directory is owned by root and not by the app, and you can't put things in there programmatically.

If you can figure out why it's not always being extracted to lib automatically, then great.

Thanks

@skabbes

This comment has been minimized.

Show comment
Hide comment
@skabbes

skabbes Jan 11, 2012

Contributor

If you place the lib in APP_ROOT/lib/armeabi/libjninode.so, then the library will automatically be be placed in the correct library location of your app.

Then you can use System.loadLibrary("jninode") instead of System.load("/path/to/lib"). This is how Android NDK apps load shared libraries afaik. This doesn't solve the problem of how to load bridge.node, but it is at least a start.

Contributor

skabbes commented Jan 11, 2012

If you place the lib in APP_ROOT/lib/armeabi/libjninode.so, then the library will automatically be be placed in the correct library location of your app.

Then you can use System.loadLibrary("jninode") instead of System.load("/path/to/lib"). This is how Android NDK apps load shared libraries afaik. This doesn't solve the problem of how to load bridge.node, but it is at least a start.

@paddybyers

This comment has been minimized.

Show comment
Hide comment
@paddybyers

paddybyers Jan 11, 2012

Owner

Hmm, fancy doing a PR for it? :)

Owner

paddybyers commented Jan 11, 2012

Hmm, fancy doing a PR for it? :)

@skabbes

This comment has been minimized.

Show comment
Hide comment
@skabbes

skabbes Jan 11, 2012

Contributor

Yep, I'll look into it later today.

Contributor

skabbes commented Jan 11, 2012

Yep, I'll look into it later today.

@paddybyers

This comment has been minimized.

Show comment
Hide comment
@paddybyers

paddybyers Jan 11, 2012

Owner

thanks

Owner

paddybyers commented Jan 11, 2012

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment