Zxing library cannot be resolved

I am developing an application with zxing library. I have imported the project zxing

to my workstation. When I imported there were some problems I ran into.

  • Compile the project java 1.7

    . I did it.
  • CameraConfigurationUtils

    is absent. I copied from library source

    .
  • Resource id's

    cannot be used for verification switch case

    . I changed it to if else

    .

But finally in 1. emailResult.getTos()

did not resolve in EmailAddressResultHandler

2. Then I built the project and the problem cannot be solved in the whole application. R.java

What am I doing wrong?

+3


source to share


4 answers


I think you were using 3.10 or older built-in jar, but your ZXing project is from GitHub, which should use the 3.1.1-snapshot.jar build with maven. Last month the APIs were changed according to https://github.com/zxing/zxing/commit/8158984458f6db59b462ef2b4dd270321c66f203



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

+1


source


There are many mistakes here.

CameraConfigurationUtils

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

EmailAddressResultHandler

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



You are trying to use android/

as a library project if you see this error in switch

. It is not a library and should not be used this way.

R.java

generated by your assembly. You haven't configured your Android project correctly.

I suggest that if you are struggling with using Maven and Android projects you should not copy the project code into your project. I think you are heading towards using the project in a way that does not comply with the license: https://github.com/zxing/zxing/wiki/License-Questions It would be much easier for you to start with the integration Intent

: https://github.com / zxing / zxing / wiki / Scanning-Via-Intent

+1


source


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

0


source


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

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

Mistake

for me.

0


source







All Articles