Android的工作室(0.3.2)和ZXing [英] Android Studio (0.3.2) and ZXing
问题描述
我不能让ZXing到Android Studio中工作。我已经生成使用Ant的core.jar添加文件,同样的罐子使用Eclipse工作的罚款。现在,我必须得到它的Android Studio中工作(0.3.2)。
I cannot get ZXing to work in Android Studio. I have generated the core.jar file using Ant, and the same jar worked fine using Eclipse. Now I must get it working in Android Studio (0.3.2).
下面是我试过,但无济于事至今:
Here is what I have tried but to no avail so far:
- 的core.jar添加文件复制到PROJECTNAMEProject / PROJECTNAME /库/
- 右键单击>添加为库
- 选择项目库中的级别
创建库对话框中,用添加到模块设置为
PROJECTNAME文件夹。我曾尝试全局和模块库类型
以及项目库。 - 添加
编译文件(库/ core.jar添加')
来
的依赖关系部分
PROJECTNAMEProject / PROJECTNAME /的build.gradle
我得到的错误似乎在告诉我,我,包括两次的jar:
The error I'm getting seems to be telling me I'm including the jar twice:
摇篮:意外的顶级例外:
摇篮:java.lang.IllegalArgumentException异常:已添加:LCOM /谷歌/ zxing /酒吧codeFormat;
Gradle: UNEXPECTED TOP-LEVEL EXCEPTION: Gradle: java.lang.IllegalArgumentException: already added: Lcom/google/zxing/BarcodeFormat;
推荐答案
如果您添加编译文件(库/ core.jar添加')
到的build.gradle
,如果您需要做的唯一的另一件事就是点击同步工程与摇篮文件工具栏中的按钮。
If you add the compile files('libs/core.jar')
to build.gradle
, the only other thing you should need to do is click the Sync Project with Gradle Files button in the toolbar.
这篇关于Android的工作室(0.3.2)和ZXing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!