apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 29 defaultConfig { applicationId "com.google.mlkit.vision.demo" minSdkVersion 16 multiDexEnabled true targetSdkVersion 29 versionCode 11 versionName "1.11" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true setProperty("archivesBaseName", "vision-quickstart") } buildTypes { proguard { debuggable false minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard.cfg' testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-rules.pro', 'proguard.cfg' } testBuildType "proguard" release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { minifyEnabled false proguardFiles 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } // Do NOT compress tflite model files (need to call out to developers!) aaptOptions { noCompress "tflite" } } repositories { // Depending on AndroidX Snapshot Builds to get the latest CameraX libs. maven { url 'https://androidx.dev/snapshots/builds/6787662/artifacts/repository/' } } dependencies { implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72' implementation 'androidx.multidex:multidex:2.0.1' // Barcode model implementation 'com.google.mlkit:barcode-scanning:16.1.0' // Or comment the dependency above and uncomment the dependency below to // use unbundled model that depends on Google Play Services // implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:16.1.3' // Object detection feature with bundled default classifier //implementation 'com.google.mlkit:object-detection:16.2.2' // Object detection feature with custom classifier support //implementation 'com.google.mlkit:object-detection-custom:16.3.0' // Face features //implementation 'com.google.mlkit:face-detection:16.0.3' // Or comment the dependency above and uncomment the dependency below to // use unbundled model that depends on Google Play Services // implementation 'com.google.android.gms:play-services-mlkit-face-detection:16.1.2' // Text features //implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.2' // Image labeling //implementation 'com.google.mlkit:image-labeling:17.0.1' // Or comment the dependency above and uncomment the dependency below to // use unbundled model that depends on Google Play Services // implementation 'com.google.android.gms:play-services-mlkit-image-labeling:16.0.1' // Image labeling custom //implementation 'com.google.mlkit:image-labeling-custom:16.3.0' // Pose detection with default models //implementation 'com.google.mlkit:pose-detection:17.0.1-beta1' // Pose detection with accurate models //implementation 'com.google.mlkit:pose-detection-accurate:17.0.1-beta1' // ------------------------------------------------------- //implementation 'com.google.code.gson:gson:2.8.5' implementation 'com.google.guava:guava:27.1-android' // For how to setup gradle dependencies in Android X, see: // https://developer.android.com/training/testing/set-up-project#gradle-dependencies // Core library androidTestImplementation 'androidx.test:core:1.3.0' // AndroidJUnitRunner and JUnit Rules androidTestImplementation 'androidx.test:runner:1.3.0' androidTestImplementation 'androidx.test:rules:1.3.0' // Assertions androidTestImplementation 'androidx.test.ext:junit:1.1.2' // ViewModel and LiveData // implementation "androidx.lifecycle:lifecycle-livedata:2.2.0" // implementation "androidx.lifecycle:lifecycle-viewmodel:2.2.0" implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.annotation:annotation:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' // CameraX // implementation "androidx.camera:camera-camera2:1.0.0-SNAPSHOT" // implementation "androidx.camera:camera-lifecycle:1.0.0-SNAPSHOT" // implementation "androidx.camera:camera-view:1.0.0-SNAPSHOT" } configurations { // Resolves dependency conflict caused by some dependencies use // com.google.guava:guava and com.google.guava:listenablefuture together. all*.exclude group: 'com.google.guava', module: 'listenablefuture' }