为android项目构建库ZXing [英] build library ZXing for android project

查看:31
本文介绍了为android项目构建库ZXing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 ZXing 库为我的 android 应用程序制作二维码扫描仪
我已经成功尝试使用通过意图扫描"方法
现在我尝试不同的方法

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

我的步骤
1.从这里
下载zxing master2. 从存储库下载 jar 这里
3.在eclipse中从zxing-master导入‘android’文件夹
4. 创建 libs 文件夹并将 core.jar 复制到其中
5.在CaptureActivity中右键-属性-java构建路径-库选项卡-添加core.jar路径

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

我不知道为什么在添加 jar 路径后仍然出现错误...
我已经尝试使用最新的 jar 文件但仍然相同
有什么想法吗?

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

日食错误低于 1.7 的源代码级别不允许使用<>"运算符

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

我尝试使用 1.7(默认 1.6)更改 java 编译器
右键单击项目 - 属性 - Java 编译器选项卡
但似乎我的目标 API 没有满足要求(我的 API 15)
java编译器1.6如何使用ZXing?

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?

更新@Sean Owen

当我使用 java 编译器级别 1.7 更改并清理项目时,它说

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

我想针对 ICS (API 15) 运行我的应用程序
我不确定在captureActivity androidManifest using minSDK 19"和myProject androidManifest using minSDK 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

所以我想我最好坚持使用 java 编译器 1.6

so i guess i better stick with java compiler 1.6

同时我发现了这个链接基于该链接,我需要使用 zxing 库版本 4.5.1(java 编译器 1.6)因为以上版本使用java编译器1.7

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

但是我找不到zxing library version 4.5.1"的任何下载链接

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

推荐答案

你的问题不是很清楚,但我认为答案是这样的:源代码确实需要 Java 7.你只需要将你的 IDE 项目设置为使用 Java7. 提供的 Maven 构建在这方面已经正常工作.API 15 或任何其他 Android API 需要 Java 6 是不正确的.

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.

这篇关于为android项目构建库ZXing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆