0

I've been having some difficulties over the past couple of days and can't seem to get it working. I'm trying to add the zbar library to my project:

https://github.com/dm77/ZBarScanner

Can anyone guide me through the process? Thanks!

Mason M
  • 67
  • 8
  • here, hope it helps: http://stackoverflow.com/questions/8248196/how-to-add-a-library-project-to-a-android-project – fersarr Dec 31 '14 at 16:51
  • 1
    That library is no longer being maintained. [The replacement library](https://github.com/dm77/barcodescanner) can be retrieved through `compile 'me.dm7.barcodescanner:zxing:1.6'` in your `dependencies` closure in `build.gradle`. – CommonsWare Dec 31 '14 at 16:52
  • 1
    check this : http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio – TooCool Dec 31 '14 at 16:53

1 Answers1

0

The key is to add a dependency from the application project, in the ÷build.gradle÷ file:

dependencies {
    compile files('libs/android-support-v4.jar')
    compile project(':Zbar_Project_Name')
}

And, in the IntelliJ Module file, ??.iml:

<orderEntry type="library" name="android-support-v4" level="application" />
<orderEntry type="library" name="Zbar_Project_Name.aar" level="project" />

In the library project, there’s not much to do: tell Gradle and Android Studio that this is an Android library, with apply plugin:

android-library

and

<option name=”LIBRARY_PROJECT” value=”true” />

respectively.

Hana Bzh
  • 2,212
  • 3
  • 18
  • 38