It is recommended that developers obtain the Barcode SDK via Maven. Simply make this addition to your project build.gradle to define the Vuzix repository.

Java

allprojects {
repositories {
google()
jcenter()
// The speech SDK is currently hosted by jitpack
maven { url "https://jitpack.io" }
}
}


Then add a dependency to the Barcode SDK library in your application build.gradle

Java

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.vuzix:sdk-barcode:1.6'
}


Proguard Rules

If you are using Proguard you will need to prevent obfuscating the Vuzix Barcode SDK. Failure to do so will result in calls to the SDK raising the RuntimeException "Stub!". Add the following -keep statement to the proguard rules file, typically named proguard-rules.pro.

Java

-keep class com.vuzix.sdk.barcode.** { *; }


The R8 Optimization may omit arguments required by the SDK methods, resulting in the NullPointerException "throw with null exception" being raised. The current workaround is to disable R8 and use Proguard to do the shrinking and obfuscation. Add the following to your gradle.properties to change from R8 to Proguard.

Java

android.enableR8=false


Did this answer your question?