Android Studio (0.3.2) and ZXing

I cannot get ZXing to work in Android Studio. I created the core.jar file using Ant, and the same jar worked fine using Eclipse. Now I have to get it working in Android Studio (0.3.2).

Here is what I tried, but haven’t understood anything yet:

  • Copy core.jar to PROJECTNAMEProject / PROJECTNAME / libs /
  • Right Click> Add As Library
  • Select “Project Library” as “Level” in the “Create Library” dialog box, with the words “Add to Module”, PROJECTNAME Folder. I tried the Global and Module library types as well as the project libraries.
  • Add compile files('libs/core.jar') to the dependencies section PROJECTNAMEProject / Projectname / build.gradle

The error I get seems to tell me that I turn on the jar twice:

Gradle: UNDEFINED FUEL EXCEPTION: Gradle: java.lang.IllegalArgumentException: already added: Lcom / google / zxing / BarcodeFormat;

+1
android-studio jar zxing
Dec 02 '13 at 17:47
source share
1 answer

If you add compile files('libs/core.jar') to build.gradle , you will need to do one more thing, click the Sync Project button using the Gradle Files toolbar.

+2
Dec 02 '13 at 19:44
source share



All Articles