13

I have downloaded the Zxing Barcode Scanner code for Android, but I can't find the package com.google.zxing in the source code. I think there's a missing library or JAR file for the project. Can anybody help me find that package?

These are the unresolved imports:

  import com.google.zxing.BarcodeFormat;
  import com.google.zxing.Result;
  import com.google.zxing.ResultMetadataType;
  import com.google.zxing.ResultPoint;
Yojimbo
  • 23,288
  • 5
  • 44
  • 48
Rana.S
  • 2,265
  • 3
  • 20
  • 19
  • @Rana.S, did you find an answer? Why not share it and accept that. – Urs Reupke May 28 '12 at 10:21
  • Readers are encouraged to upvote, comment any solutions that are helpful. Contributors will state their success in an **Answer** with a instructions, procedure code to advance future problem solvers – gatorback Dec 15 '19 at 14:52

2 Answers2

15

The classes you are looking for are in the core module.

Urs Reupke
  • 6,791
  • 3
  • 35
  • 49
  • so the core file generated with appache ant has to be added as external jar file even for the new project – png Dec 27 '11 at 10:12
  • @png If you were successful, please consider either creating your own answer or adding to the above existing answer stating success and the procedure \ steps required. – gatorback Dec 15 '19 at 15:14
7

What a headache to see the classes in the download.zip's core folder but there is no "core.jar", so here's where to get that jar file...

https://github.com/zxing/zxing/wiki/Getting-Started-Developing

  1. Under "Just Need a Jar", click the "Maven release repository" link.
  2. Click "core/"
  3. Click on the Zxing version you downloaded. (Though mine is 4.7.5 (shown on zip folder name) it worked with version 3.2.1
  4. Click on core-x.x.x.jar to download. (x's are version number)

I put that core.jar where the Zxing project folder is, inside core folder so I wouldn't lose it.

After that, (if using Eclipse)

  1. Right click CaptureActivity project -> Build Path -> Configure Build Path
  2. (Left Side Select) Java Build Path
  3. Libraries tab
  4. Add External JARs...
  5. Select the core-x.x.x.jar previously downloaded
  6. Click OK

This took all those missing errors away for me, but left errors in switch statements that I read needs to be changed to if/else statements, but that's for another topic.

gatorback
  • 1,351
  • 4
  • 19
  • 44
dataricc
  • 81
  • 1
  • 3
  • @dataicc For the final errors in switch statements, is there a link that illuminates and resolves said errors? – gatorback Dec 15 '19 at 14:58
  • Thank you, it really helped me. I use Intellij Idea, litte bit different for adding jar, but generally the same. – Yeras_QazaQ Jul 28 '23 at 03:15