java.lang.NoSuchFieldError: No static field MAXICODE of type Lcom/google/zxing/BarcodeFormat; in class Lcom/google/zxing/BarcodeFormat;

Roberto Capah :

I want to implement library of barcode scanner from https://github.com/dm77/barcodescanner. and I getting error after I run the project like this

java.lang.NoSuchFieldError: No static field MAXICODE of type Lcom/google/zxing/BarcodeFormat; in class Lcom/google/zxing/BarcodeFormat; or its >superclasses (declaration of 'com.google.zxing.BarcodeFormat' appears in /data/app/com.myPro.simantra-2/base.apk:classes3.dex) at me.dm7.barcodescanner.zxing.ZXingScannerView.(ZXingScannerView.java:54) at com.myPro.ActivityMainMenu.onCreate(ActivityMainMenu.java:226)

after I debug this I find the error is while code run at

mScannerView = new ZXingScannerView(this);

but if I make a new Project and implement this, it will running well.

Roberto Capah :

This problem has been solved. the problem is in my old project/Library that Imported to current project I was compiled old

core.jar

that doesn't contain

MAXICODE in Lcom/google/zxing/BarcodeFormat class.

so to fix the problem just simply comment

implementation files('libs/jars/core.jar')

in gradle. Thank you

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=167245&siteId=1