Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Dependency ZXing android embedded

I've started a new project in Android Studio and I want to import the zxing-android-embedded to allow to me create a simple barcode scanner within my application. Found here on github

Following instruction on there and also on different sources like this SO answer: https://stackoverflow.com/a/23788163/3364482

However I have added the compile optins to my build.gradle but I'm getting the "Failed to resolve" errors:

Failed to resolve: com.google.zxing:core:3.2.0
Failed to resolve: com.journeyapps:zxing-android-embedded:2.3.0
Failed to resolve: com.journeyapps:zxing-android-integration:2.3.0

But as far as I'm aware my buid.gradle is as instructed:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.myapps.practice.helloworld"
    minSdkVersion 19
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}
repositories {
    jcenter()
}
dependencies {
    compile 'com.journeyapps:zxing-android-embedded:2.3.0@aar'
    compile 'com.journeyapps:zxing-android-integration:2.3.0@aar'
    compile 'com.google.zxing:core:3.2.0'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
}

EDIT: I'm not in Offline Mode.

like image 543
MikeS Avatar asked May 15 '26 23:05

MikeS


1 Answers

Try this, this is the most recent version from git:

dependencies {
    compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
    compile 'com.google.zxing:core:3.2.1'
    compile 'com.android.support:appcompat-v7:23.1.0'   // Version 23+ is required
}

android {
    buildToolsVersion '23.0.2' // Older versions may give compile errors
}
like image 114
Tom Sabel Avatar answered May 18 '26 12:05

Tom Sabel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!