I am making an app in android studio that uses a bar code scanner. I am using the Google ZXing lib. I downloaded the zip, opened the project and added the core.jar file as instructed but the tutorial was for eclipse and there is no option to add as library in android studio. so I am stuck on how to add it. any help would be greatly appreciated :)
Simple way with mvn repo:
dependencies {
compile 'com.google.zxing:core:3.0.0'
}
The more work version without mvn repo:
dependencies {
compile files('./libs/zxing/core.jar')
}
So whichever version you pick, look for the dependencies block in your build.gradle, then add in the appropriate compile line. Remember to add it into the build.gradle for your app module, not the root build.gradle.
Sample directory layout: /approot
/approot/build.gradle
/approot/myfancyapp
/approot/myfancyapp/build.gradle <--- this one!
/approot/myfancyapp/libs/zxing/core.jar <--- put the jar here or any path, just an example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With