Surya Matadewa
Surya Matadewa

Reputation: 1027

build library ZXing for android project

hi i want to make QR code scanner to my android app using ZXing library
i already success try it with "Scanning via Intent" method before
now i try different approach

my problem is i always get this error

enter image description here

my step
1. download zxing master from here
2. download jar from repository here
3. import ‘android’ folder from zxing-master in eclipse
4. create libs folder and copy core.jar in there
5. right click in CaptureActivity - properties - java build path - library tab - add core.jar path

i don't know why i still get error after add jar path...
i already try clean project, swith workspace, using latest jar file but still same
any idea?


@update @Nickolai Astashonok

eclipse error '<>' operator is not allowed for source level below 1.7

i try to change java compiler using 1.7 (default 1.6) by
right click project - properties - java compiler tab
but it's seem my target API not fullfil requirment (my API 15)
how to use ZXing in java compiler 1.6?


Update @Sean Owen

when i changed using java compiler level 1.7 and clean project it's says

Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 15

i wanna target my aplication runs for ICS (API 15)
i'm not sure if in 'captureActivity androidManifest using minSDK 19' and 'myProject androidManifest using minSDK 15 will be running well

so i guess i better stick with java compiler 1.6

meanwhile i found this link based on that link i need to use zxing library version 4.5.1 (java compiler 1.6) because version above using java compiler 1.7

enter image description here

but i can't find any download link to 'zxing library version 4.5.1'

Upvotes: 1

Views: 2247

Answers (3)

kwytse
kwytse

Reputation: 113

I got the same issue and I solve this by doing:

  1. change the java compiler to 1.7 (like what Nickolai Astashonok suggested)
  2. change the target version to 19 (Android 4.4)
  3. Clean the project again, you will see lots of errors removed but there is still some errors related to missing of CameraConfigurationUtils.java Please go to below link to download and copy the file into your project as per the path suggested.

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

  1. Clean the project again, you should be able to clear all the errors and use the sample application in the 'android' folder.

Upvotes: 0

Hirad Roshandel
Hirad Roshandel

Reputation: 2187

I found 4.5.1 but I don't know how to download it! if you figured it out let me know too please. https://code.google.com/p/zxing/source/browse/?r=2927#svn%2Ftrunk%2Fandroid

Upvotes: 0

Sean Owen
Sean Owen

Reputation: 66881

Your question is not clear, but I think the answer is this: the source code indeed requires Java 7. You simply need to set your IDE project to use Java 7. The supplied Maven build already works correctly in this regard. It is not true that API 15 or any other Android API needs Java 6.

Upvotes: 1

Related Questions