build.gradle 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. def localProperties = new Properties()
  2. def localPropertiesFile = rootProject.file('local.properties')
  3. if (localPropertiesFile.exists()) {
  4. localPropertiesFile.withReader('UTF-8') { reader ->
  5. localProperties.load(reader)
  6. }
  7. }
  8. def flutterRoot = localProperties.getProperty('flutter.sdk')
  9. if (flutterRoot == null) {
  10. throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
  11. }
  12. def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
  13. if (flutterVersionCode == null) {
  14. flutterVersionCode = '1'
  15. }
  16. def flutterVersionName = localProperties.getProperty('flutter.versionName')
  17. if (flutterVersionName == null) {
  18. flutterVersionName = '1.0'
  19. }
  20. apply plugin: 'com.android.application'
  21. apply plugin: 'kotlin-android'
  22. apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  23. android {
  24. compileSdkVersion 28
  25. sourceSets {
  26. main.java.srcDirs += 'src/main/kotlin'
  27. }
  28. lintOptions {
  29. disable 'InvalidPackage'
  30. }
  31. productFlavors {
  32. baidu {}
  33. douyin {}
  34. xiaomi {}
  35. huawei {}
  36. vivo {}
  37. oppo {}
  38. yinyongbao {}
  39. productFlavors.all { flavor ->
  40. flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
  41. }
  42. }
  43. defaultConfig {
  44. applicationId "com.tyty.liftmanager"
  45. minSdkVersion 21
  46. targetSdkVersion 30
  47. versionCode flutterVersionCode.toInteger()
  48. versionName flutterVersionName
  49. flavorDimensions "versionCode"
  50. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  51. ndk {
  52. //设置支持的SO库架构
  53. abiFilters 'armeabi-v7a'//, 'arm64-v8a', 'x86', 'x86_64'
  54. }
  55. manifestPlaceholders = [
  56. PACKAGE_NAME : applicationId,
  57. XG_ACCESS_ID : "2100320854",
  58. XG_ACCESS_KEY: "A7D99HE19CAX",
  59. HW_APPID : "10839500",
  60. JPUSH_PKGNAME : applicationId,
  61. JPUSH_APPKEY : "bd76ee7fb5dac9d04b12a521", // NOTE: JPush 上注册的包名对应的 Appkey.
  62. JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
  63. XIAOMI_APPKEY : "MI-5131748552829", // 小米平台注册的appkey,注意不要将前缀去掉 MI-appkey
  64. XIAOMI_APPID : "MI-2882303761517485829", // 小米平台注册的appid,注意不要将前缀去掉 MI-appid
  65. VIVO_APPKEY:"f3bfac7169bc3ab9d3e0c050e018d26a",
  66. VIVO_APPID:"100104950"
  67. ]
  68. multiDexEnabled true
  69. }
  70. signingConfigs {
  71. release {
  72. keyAlias 'liftmanager'
  73. keyPassword 'zhengmin123456'
  74. storeFile file('../../liftmanager.jks')
  75. storePassword 'zhengmin123456'
  76. }
  77. debug {
  78. keyAlias 'liftmanager'
  79. keyPassword 'zhengmin123456'
  80. storeFile file('../../liftmanager.jks')
  81. storePassword 'zhengmin123456'
  82. }
  83. }
  84. buildTypes {
  85. release {
  86. ndk {
  87. //这里要加上,否则debug包会出问题,后面三个为可选,x86建议加上不然部分模拟器回报错
  88. abiFilters "armeabi"
  89. // signingConfig signingConfigs.release
  90. }
  91. shrinkResources true
  92. minifyEnabled true
  93. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  94. // Signing with the debug keys for now, so `flutter run --release` works.
  95. signingConfig signingConfigs.release
  96. }
  97. debug {
  98. ndk {
  99. //这里要加上,否则debug包会出问题,后面三个为可选,x86建议加上不然部分模拟器回报错
  100. abiFilters "armeabi", "armeabi-v7a","arm64-v8a", "x86"
  101. }
  102. signingConfig signingConfigs.debug
  103. }
  104. }
  105. }
  106. flutter {
  107. source '../..'
  108. }
  109. dependencies {
  110. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  111. testImplementation 'junit:junit:4.12'
  112. androidTestImplementation 'androidx.test:runner:1.1.1'
  113. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  114. implementation project(":libs")
  115. implementation 'cn.jiguang.sdk.plugin:xiaomi:4.0.6'//版本号和对应的JPush版本号相同
  116. implementation 'com.huawei.hms:push:5.0.2.300'
  117. //引入极光-华为插件,如果采用此配置,无需拷贝jpush-android-plugin-huawei-v3.x.x.jar文件,也无需配置cn.jpush.android.service.PluginHuaweiPlatformsService组件
  118. implementation 'cn.jiguang.sdk.plugin:huawei:4.0.6'
  119. implementation 'cn.jiguang.sdk.plugin:vivo:4.0.6'
  120. }