build.gradle 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'kotlin-android'
  3. apply plugin: 'kotlin-android-extensions'
  4. android {
  5. compileSdkVersion 29
  6. defaultConfig {
  7. applicationId "com.google.mlkit.vision.demo"
  8. minSdkVersion 16
  9. multiDexEnabled true
  10. targetSdkVersion 29
  11. versionCode 11
  12. versionName "1.11"
  13. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  14. vectorDrawables.useSupportLibrary = true
  15. setProperty("archivesBaseName", "vision-quickstart")
  16. }
  17. buildTypes {
  18. proguard {
  19. debuggable false
  20. minifyEnabled true
  21. shrinkResources true
  22. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard.cfg'
  23. testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguardTest-rules.pro', 'proguard.cfg'
  24. }
  25. testBuildType "proguard"
  26. release {
  27. minifyEnabled true
  28. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  29. }
  30. debug {
  31. minifyEnabled false
  32. proguardFiles 'proguard-rules.pro'
  33. }
  34. }
  35. compileOptions {
  36. sourceCompatibility JavaVersion.VERSION_1_8
  37. targetCompatibility JavaVersion.VERSION_1_8
  38. }
  39. // Do NOT compress tflite model files (need to call out to developers!)
  40. aaptOptions {
  41. noCompress "tflite"
  42. }
  43. }
  44. repositories {
  45. // Depending on AndroidX Snapshot Builds to get the latest CameraX libs.
  46. maven { url 'https://androidx.dev/snapshots/builds/6787662/artifacts/repository/' }
  47. }
  48. dependencies {
  49. implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'
  50. implementation 'androidx.multidex:multidex:2.0.1'
  51. // Barcode model
  52. implementation 'com.google.mlkit:barcode-scanning:16.1.0'
  53. // Or comment the dependency above and uncomment the dependency below to
  54. // use unbundled model that depends on Google Play Services
  55. // implementation 'com.google.android.gms:play-services-mlkit-barcode-scanning:16.1.3'
  56. // Object detection feature with bundled default classifier
  57. //implementation 'com.google.mlkit:object-detection:16.2.2'
  58. // Object detection feature with custom classifier support
  59. //implementation 'com.google.mlkit:object-detection-custom:16.3.0'
  60. // Face features
  61. //implementation 'com.google.mlkit:face-detection:16.0.3'
  62. // Or comment the dependency above and uncomment the dependency below to
  63. // use unbundled model that depends on Google Play Services
  64. // implementation 'com.google.android.gms:play-services-mlkit-face-detection:16.1.2'
  65. // Text features
  66. //implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.2'
  67. // Image labeling
  68. //implementation 'com.google.mlkit:image-labeling:17.0.1'
  69. // Or comment the dependency above and uncomment the dependency below to
  70. // use unbundled model that depends on Google Play Services
  71. // implementation 'com.google.android.gms:play-services-mlkit-image-labeling:16.0.1'
  72. // Image labeling custom
  73. //implementation 'com.google.mlkit:image-labeling-custom:16.3.0'
  74. // Pose detection with default models
  75. //implementation 'com.google.mlkit:pose-detection:17.0.1-beta1'
  76. // Pose detection with accurate models
  77. //implementation 'com.google.mlkit:pose-detection-accurate:17.0.1-beta1'
  78. // -------------------------------------------------------
  79. //implementation 'com.google.code.gson:gson:2.8.5'
  80. implementation 'com.google.guava:guava:27.1-android'
  81. // For how to setup gradle dependencies in Android X, see:
  82. // https://developer.android.com/training/testing/set-up-project#gradle-dependencies
  83. // Core library
  84. androidTestImplementation 'androidx.test:core:1.3.0'
  85. // AndroidJUnitRunner and JUnit Rules
  86. androidTestImplementation 'androidx.test:runner:1.3.0'
  87. androidTestImplementation 'androidx.test:rules:1.3.0'
  88. // Assertions
  89. androidTestImplementation 'androidx.test.ext:junit:1.1.2'
  90. // ViewModel and LiveData
  91. // implementation "androidx.lifecycle:lifecycle-livedata:2.2.0"
  92. // implementation "androidx.lifecycle:lifecycle-viewmodel:2.2.0"
  93. implementation 'androidx.appcompat:appcompat:1.2.0'
  94. implementation 'androidx.annotation:annotation:1.1.0'
  95. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  96. // CameraX
  97. // implementation "androidx.camera:camera-camera2:1.0.0-SNAPSHOT"
  98. // implementation "androidx.camera:camera-lifecycle:1.0.0-SNAPSHOT"
  99. // implementation "androidx.camera:camera-view:1.0.0-SNAPSHOT"
  100. }
  101. configurations {
  102. // Resolves dependency conflict caused by some dependencies use
  103. // com.google.guava:guava and com.google.guava:listenablefuture together.
  104. all*.exclude group: 'com.google.guava', module: 'listenablefuture'
  105. }