build.gradle 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
  5. id "dev.flutter.flutter-gradle-plugin"
  6. }
  7. android {
  8. namespace = "com.eitchsyh.instrument.eitc_erm_dental_flutter"
  9. compileSdk = flutter.compileSdkVersion
  10. //ndkVersion = flutter.ndkVersion
  11. ndkVersion = "26.1.10909125"
  12. compileOptions {
  13. sourceCompatibility = JavaVersion.VERSION_1_8
  14. targetCompatibility = JavaVersion.VERSION_1_8
  15. }
  16. kotlinOptions {
  17. jvmTarget = JavaVersion.VERSION_1_8
  18. }
  19. packagingOptions {
  20. // Fixes duplicate libraries build issue,
  21. // when your project uses more than one plugin that depend on C++ libs.
  22. pickFirst 'lib/**/libc++_shared.so'
  23. }
  24. defaultConfig {
  25. applicationId = "com.eitchsyh.instrument"
  26. // You can update the following values to match your application needs.
  27. // For more information, see: https://flutter.dev/to/review-gradle-config.
  28. //minSdk = flutter.minSdkVersion
  29. minSdk = 24
  30. targetSdk = flutter.targetSdkVersion
  31. versionCode = flutter.versionCode
  32. versionName = flutter.versionName
  33. ndk {
  34. //noinspection ChromeOsAbiSupport
  35. abiFilters /*"armeabi-v7a",*/ "arm64-v8a"
  36. }
  37. }
  38. externalNativeBuild {
  39. cmake {
  40. path file('src/main/cpp/CMakeLists.txt')
  41. version '3.22.1'
  42. }
  43. }
  44. signingConfigs {
  45. release {
  46. storeFile file('../key.keystore')
  47. storePassword 'guonenghuizhi888'
  48. keyAlias 'jsyg'
  49. keyPassword 'guonenghuizhi888'
  50. }
  51. }
  52. buildTypes {
  53. release {
  54. minifyEnabled true//开启混淆
  55. shrinkResources true//去除无用资源
  56. zipAlignEnabled true//资源对齐
  57. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  58. signingConfig signingConfigs.release
  59. }
  60. }
  61. flavorDimensions "app"
  62. //多渠道打包配置,运行时需要加上flavor名字,例如flutter run --flavor hsjk
  63. productFlavors {
  64. //慧视健康,默认
  65. hsjk {
  66. dimension = "app"
  67. }
  68. //慧视通
  69. hst {
  70. dimension = "app"
  71. applicationId = "com.hst.instrument"
  72. }
  73. }
  74. }
  75. flutter {
  76. source = "../.."
  77. }