New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "png_set_longjmp_fn" referenced by .... #3

Closed
tagantroy opened this Issue Jun 2, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@tagantroy

tagantroy commented Jun 2, 2015

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "png_set_longjmp_fn" referenced by "libExample.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:364)
at java.lang.System.loadLibrary(System.java:526)
at com.example.ARActivity.(ARActivity.java:92)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)

Problem on nexus 5 with 4.4 android.

@julienr

This comment has been minimized.

Show comment
Hide comment
@julienr

julienr Jun 2, 2015

Owner

Do you compile libpng as a shared library ? If yes, do you load the library with System.loadLibrary("libpng") (in addition to your libExample) ?

Owner

julienr commented Jun 2, 2015

Do you compile libpng as a shared library ? If yes, do you load the library with System.loadLibrary("libpng") (in addition to your libExample) ?

@tagantroy

This comment has been minimized.

Show comment
Hide comment
@tagantroy

tagantroy Jun 3, 2015

Android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := libpng
LOCAL_SRC_FILES = $(LIBRARIES_PATH)/android/libpng.so
include $(PREBUILT_SHARED_LIBRARY)

private static final String NATIVE_LIB_LIBPNG = "png";
private static final String NATIVE_LIB_EXAMPLE = "Example";
static{
...
System.loadLibrary(NATIVE_LIB_LIBPNG);
...
System.loadLibrary(NATIVE_LIB_EXAMPLE);
}

tagantroy commented Jun 3, 2015

Android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := libpng
LOCAL_SRC_FILES = $(LIBRARIES_PATH)/android/libpng.so
include $(PREBUILT_SHARED_LIBRARY)

private static final String NATIVE_LIB_LIBPNG = "png";
private static final String NATIVE_LIB_EXAMPLE = "Example";
static{
...
System.loadLibrary(NATIVE_LIB_LIBPNG);
...
System.loadLibrary(NATIVE_LIB_EXAMPLE);
}

@tagantroy

This comment has been minimized.

Show comment
Hide comment
@tagantroy

tagantroy Jun 3, 2015

static library - working fine.
shared library - crash on 4.4 android.

tagantroy commented Jun 3, 2015

static library - working fine.
shared library - crash on 4.4 android.

@tagantroy tagantroy closed this Jun 3, 2015

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