-
Notifications
You must be signed in to change notification settings - Fork 1.4k
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "png_set_longjmp_fn" referenced by "liblept.so"... #106
Comments
Do you get the same error when you run the unit tests? |
And do you also get the same error when you run on a non-Cyanogen-mod device, or an emulator? |
@rmtheis I will try. How would I run the unit tests? I am using windows as my development machine. |
@Linkaan if you are using android studio, you should post your build.gradle file for tess-two |
@smac89 Thanks for the tip, I just added it. |
I got the same error while trying to get a new instance of TessBaseAPI and I think that it's a bug in the master version of tess-two. Now I downloaded version 5.1.0 and everything works just fine. Maybe this can solve your problem, too. |
@Linkaan apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 22
ndk {
moduleName "tess-two"
}
}
sourceSets.main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
res.srcDirs = ['res']
jniLibs.srcDir 'libs'
jni.srcDirs = []
aidl.srcDirs = ['src']
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-project.txt')
}
}
} Also make sure your # tess-two
-keep class com.googlecode.leptonica.android.Box {
private long mNativeBox;
}
-keep class com.googlecode.leptonica.android.Boxa {
private long mNativeBoxa;
}
-keep class com.googlecode.leptonica.android.Pix {
private long mNativePix;
}
-keep class com.googlecode.leptonica.android.Pixa {
private long mNativePixa;
}
-keep class com.googlecode.tesseract.android.TessBaseAPI {
private long mNativeData;
protected void onProgressValues(int, int, int, int, int, int, int, int, int);
}
-keep class com.googlecode.tesseract.android.PageIterator {
private long mNativePageIterator;
}
-keep class com.googlecode.tesseract.android.TessPdfRenderer {
private long mNativePdfRenderer;
}
-keep class com.googlecode.tesseract.android.ResultIterator {
private long mNativeResultIterator;
} |
In my case it's only happening on my note II. All my other devices are working fine. |
downloaded version 5.2.0 ,every problems is gone. |
@Linkaan Thanks for the report. This is fixed in the latest commit. |
I'm sorry, but version 5.2.0 of what component?! |
When trying to load the
lept
library, my app crashes because apparently it can't locate symbol "png_set_longjmp_fn". I tried rebuilding the libpng shared library by the name libpng-1.6.2 and changing toSystem.loadLibrary("png-1.6.2");
inTestBaseAPI.java
but it still crashes my app. I am using this example and I've compiled tess-two with the latest ndk 32 bit version.Here is the full stacktrace:
Here is my build.gradle file:
I'm running this on my Samsung Galaxy S4 ks01lte running Cyanogen-mod.
The text was updated successfully, but these errors were encountered: