Zxing library cannot be resolved

亡梦爱人 提交于 2019-12-05 23:57:54

I think you used the 3.10 or older pre-built jar, but your ZXing project is from GitHub which should use 3.1.1-snapshot.jar build with maven. The APIs had been modified last month according https://github.com/zxing/zxing/commit/8158984458f6db59b462ef2b4dd270321c66f203

I just build the core-3.1.1-SNAPSHOT and test it, it works. You can get it and replace your core.jar and try it :). I put them on my GitHub. https://github.com/voyagewu/ZXing_library/tree/master/core-3.1.1-SNAPSHOT

Lots wrong here.

CameraConfigurationUtils is not missing: https://github.com/zxing/zxing/blob/master/android-core/src/main/java/com/google/zxing/client/android/camera/CameraConfigurationUtils.java

EmailAddressResultHandler has those methods: https://github.com/zxing/zxing/blob/master/android/src/com/google/zxing/client/android/result/EmailAddressResultHandler.java I suspect you are adding several versions of the library to your project somehow.

You are trying to use android/ as a library project if you see that error about switch. It is not a library, and is not supposed to be used that way.

R.java is generated by your build. You haven't set up your Android project correctly.

I suggest that if you're struggling with using Maven and Android projects, that you should not be copying project code into your project. I think you are headed towards using the project in a way inconsistent with the license: https://github.com/zxing/zxing/wiki/License-Questions It would be far easier for you to start by integrating by Intent: https://github.com/zxing/zxing/wiki/Scanning-Via-Intent

Update the pre-built jar library: download recent snapshot/nightly builds from https://oss.sonatype.org/content/repositories/snapshots/com/google/zxing/core/

Simply copy CameraConfigurationUtils from: https://github.com/zxing/zxing/blob/master/android-core/src/main/java/com/google/zxing/client/android/camera/CameraConfigurationUtils.java

and paste file into android project's com.google.zxing.client.android.camera package..

error gone for me.

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