build.gradle 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. plugins {
  2. id "com.android.application"
  3. id "kotlin-android"
  4. id "kotlin-kapt"
  5. id "dev.flutter.flutter-gradle-plugin"
  6. }
  7. def keystoreProperties = new Properties()
  8. def keystorePropertiesFile = rootProject.file('key.properties')
  9. if (keystorePropertiesFile.exists()) {
  10. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  11. }
  12. def localProperties = new Properties()
  13. def localPropertiesFile = rootProject.file('local.properties')
  14. if (localPropertiesFile.exists()) {
  15. localPropertiesFile.withReader('UTF-8') { reader ->
  16. localProperties.load(reader)
  17. }
  18. }
  19. def flutterRoot = localProperties.getProperty('flutter.sdk')
  20. if (flutterRoot == null) {
  21. throw new Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  22. }
  23. // 模拟器运行报错时尝试开启此项
  24. // project.setProperty('target-platform', 'android-arm')
  25. android {
  26. compileSdkVersion 34
  27. compileOptions {
  28. sourceCompatibility JavaVersion.VERSION_11
  29. targetCompatibility JavaVersion.VERSION_11
  30. }
  31. kotlinOptions {
  32. jvmTarget = JavaVersion.VERSION_11
  33. }
  34. sourceSets {
  35. main.java.srcDirs += 'src/main/kotlin'
  36. }
  37. lintOptions {
  38. // 如打包出现Failed to transform libs.jar to match attributes
  39. checkReleaseBuilds false
  40. }
  41. defaultConfig {
  42. applicationId "com.hongyegroup.proanperty_management"
  43. minSdkVersion 21
  44. targetSdkVersion 34
  45. versionCode 100 //Android打包上线记得要加固并重新签名再传
  46. versionName "1.0.0"
  47. multiDexEnabled true
  48. ndk {
  49. //选择要添加的对应 cpu 类型的 .so 库。
  50. abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
  51. abiFilters 'armeabi-v7a', 'arm64-v8a'
  52. // abiFilters 'armeabi-v7a'
  53. // abiFilters 'arm64-v8a'
  54. }
  55. manifestPlaceholders = [
  56. JPUSH_PKGNAME : applicationId,
  57. JPUSH_APPKEY : "1234567890",
  58. JPUSH_CHANNEL : "developer-default",
  59. queryAllPackages: ""
  60. ]
  61. }
  62. //配置keystore签名
  63. signingConfigs {
  64. release {
  65. keyAlias keystoreProperties['keyAlias']
  66. keyPassword keystoreProperties['keyPassword']
  67. storeFile file(keystoreProperties['storeFile'])
  68. storePassword keystoreProperties['storePassword']
  69. }
  70. debug {
  71. }
  72. }
  73. buildTypes {
  74. release {
  75. signingConfig signingConfigs.release
  76. //默认系统混淆
  77. minifyEnabled true
  78. // 不显示Log
  79. buildConfigField "boolean", "LOG_DEBUG", "false"
  80. //是否可调试
  81. debuggable false
  82. //Zipalign优化
  83. zipAlignEnabled true
  84. //移除无用的resource文件
  85. shrinkResources true
  86. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  87. }
  88. debug {
  89. signingConfig signingConfigs.release
  90. //是否可调试
  91. debuggable true
  92. }
  93. }
  94. }
  95. flutter {
  96. source '../..'
  97. }
  98. dependencies {
  99. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0"
  100. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0"
  101. implementation 'com.github.bumptech.glide:glide:4.11.0'
  102. kapt 'com.github.bumptech.glide:compiler:4.11.0'
  103. implementation 'androidx.appcompat:appcompat:1.3.1' //加入AndroidX依赖
  104. implementation 'com.android.support:multidex:1.0.3'
  105. // implementation 'androidx.core:core-splashscreen:1.0.0' //启动12兼容
  106. }