-1

Solved

Finally I solved it. You can find my code Here

This is specific to this lib. I want detail explanation on how to add it in my project and use either of zxing or zbar.

As instructed compile 'me.dm7.barcodescanner:zxing:1.7' is giving gradle project failed while syncing.

I have added that lib inside libs/barcodescannerLIB

settings.gradle

include ':app'
include  ":libs:barcodescannerLib:core", ":libs:barcodescannerLib:zxing:zxing", ":libs:barcodescannerLib:zxing:sample", ":libs:barcodescannerLib:zbar:zbar", ":libs:barcodescannerLib:zbar:sample"

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.dxd.testbs"
        minSdkVersion 15
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/libs'] } }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile project(":libs:barcodescannerLib:core")
    compile project(":libs:barcodescannerLib:zxing:zxing")
    compile project(":libs:barcodescannerLib:zxing:sample")
    compile project(":libs:barcodescannerLib:zbar:zbar")
    compile project(":libs:barcodescannerLib:zbar:sample")

}
Sumit Saxena
  • 1,152
  • 9
  • 7
  • Can you share your build.gradle file? – Mohammad Arman May 16 '15 at 17:38
  • " is giving gradle project failed while syncing" -- the Gradle console (in Android Studio) or your terminal (for command-line builds) should be giving you more specific information about the nature of the problem. – CommonsWare May 16 '15 at 17:41
  • Error:(12, 0) Could not find property 'supportLibraryDependency' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@75b6d24e. – Sumit Saxena May 16 '15 at 17:43

1 Answers1

0

Add in your build.grandle file the support dependence:

dependencies {
    compile 'com.android.support:support-v4:19.+'
}
rcorbellini
  • 1,307
  • 1
  • 21
  • 42