我正在用IntelliJ为Android编写条形码阅读器应用程序。当我使用biggu_sacanner库时工作正常,但是当我用zxing库替换它时,我遇到了以下错误。我注释掉了与使用库相关的代码行,所以我没有使用它们,我只是将zxing库添加到Project Structure> Libraries。仍然得到同样的错误! 为什么呢?
Information:Using javac 1.7.0_25 to compile java sources
Information:Module "p311-lgsalestrack-android" was fully rebuilt due to project configuration/dependencies changes
Information:Compilation completed with 22 errors and 0 warnings in 8 sec
Information:22 errors
Information:0 warnings
Error:Android Dex: [p311-lgsalestrack-android] UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Android Dex: [p311-lgsalestrack-android] java.lang.IllegalArgumentException: already added: Lcom/google/zxing/BarcodeFormat;
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.command.dexer.Main.processClass(Main.java:490)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.command.dexer.Main.access$400(Main.java:67)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.command.dexer.Main.processOne(Main.java:422)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
Error:Android Dex: [p311-lgsalestrack-android] at com.android.dx.command.dexer.Main.run(Main.java:209)
Error:Android Dex: [p311-lgsalestrack-android] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:Android Dex: [p311-lgsalestrack-android] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
Error:Android Dex: [p311-lgsalestrack-android] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Error:Android Dex: [p311-lgsalestrack-android] at java.lang.reflect.Method.invoke(Method.java:606)
Error:Android Dex: [p311-lgsalestrack-android] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:139)
Error:Android Dex: [p311-lgsalestrack-android] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:261)
Error:Android Dex: [p311-lgsalestrack-android] at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Error:Android Dex: [p311-lgsalestrack-android] 1 error; aborting