Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

java.lang.NoSuchFieldError: no "I" field "mNativeData" in class "Lcom/googlecode/tesseract/android/TessBaseAPI;" or its superclasses #252

Closed
NirmalPrajapat opened this issue Sep 28, 2018 · 2 comments

Comments

@NirmalPrajapat
Copy link

NirmalPrajapat commented Sep 28, 2018

Getting java.lang.NoSuchFieldError: no "I" field "mNativeData" in class "Lcom/googlecode/tesseract/android/TessBaseAPI;" or its superclasses while running the app on all device except Samsung galaxy S7. It working well on this device but not on others.

I am using
compile group: 'com.rmtheis', name: 'tess-two', version: '9.0.0'
in my studio project.

Nirmal Prajapat

Possibly related: #82 and #166. Please add steps to reproduce the issue, and let me know if running the test cases works for you.

rmtheis

Still getting this issue after following #166. Can't use #82 because using the dependency in build.gradle.

Process: com.TessProj.tessocr, PID: 9806
java.lang.NoSuchFieldError: no field with name='mNativeData' signature='I' in class Lcom/googlecode/tesseract/android/TessBaseAPI;
at com.googlecode.tesseract.android.TessBaseAPI.nativeClassInit(Native Method)
at com.googlecode.tesseract.android.TessBaseAPI.(TessBaseAPI.java:54)
at com.fabercomputing.tessocr.TessOCR.(TessOCR.java:20)

in build.gradle
defaultConfig {
applicationId "com.fabercomputing.tessocr"
minSdkVersion 16
targetSdkVersion 17
consumerProguardFiles "proguard-rules.pro"
}

@rmtheis
Copy link
Owner

rmtheis commented Sep 29, 2018

Duplicate of #251. I suspect this problem is in your code, but you didn't say whether the test cases are working for you so I can't say for sure. As-is, the information you've provided is insufficient to reproduce this issue.

@rmtheis rmtheis closed this as completed Sep 29, 2018
@NirmalPrajapat
Copy link
Author

so method in which getting error is

public TessOCR() {
// TODO Auto-generated constructor stub
mTess = new TessBaseAPI(); <- GETTING ERROR IN THIS LINE
String datapath = MyApplication.instance.getTessDataParentDirectory();
String language = "eng";
File dir = new File(MyApplication.instance.tessDataPath());
if (!dir.exists())
dir.mkdirs();
Log.e("datapath=",datapath);
mTess.init(datapath, language);
}

In build.gradle
defaultConfig {
applicationId "com.fabercomputing.tessocr"
minSdkVersion 16
targetSdkVersion 17
consumerProguardFiles "proguard-rules.pro"
}

implementation 'com.rmtheis:tess-two:9.0.0'

This API is running only on Samsung Galaxy S7 (Oreo) but not on other devices.
Please let me know if other info is required.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants