Class not found when using zxing

五迷三道 提交于 2019-12-01 12:07:22

There are only three reasons you will ever get this error:

  1. The class genuinely doesn't exist. If you are using code from an official example and getting this, make sure you have the latest build of the library
  2. You have not added the jar to your build path. To fix this, right click on the jar in Eclipse, and do Build Path ► Add to Build Path.
  3. Your jar is not in the /libs folder. This happens when you have added the jar to the build path, but newer versions of ADT need it to be in /libs. Put it there and re-add it to the build path.

Do you have Zxing Barcode Scanner application installed? You have to install the application to scan using intent.

The CaptureActivity is not in the core.jar library. You have to include their Android project as library if you don't want to install and integrated in your own application. That's a lot of mess. Better install their application.

Another way is use Zbar library. I found this library easy to use and don't need their application installed. The only matter is if it support your desired barcode. I will recommend to check it out.

Edit:

Once I've tried to include zxing natively using this link.

Add ZXing barcode scanning natively in your Android project

ZXing QR Reader Direct Integration.

You can check this out.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!