build.gradle 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 28
  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. XIAOMI_APPID : "",
  61. XIAOMI_APPKEY: "",
  62. XG_ACCESS_SCHEME:"",
  63. JPUSH_PKGNAME : applicationId,
  64. JPUSH_APPKEY : "bd76ee7fb5dac9d04b12a521", // NOTE: JPush 上注册的包名对应的 Appkey.
  65. JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
  66. XIAOMI_APPKEY : "MI-5131748552829", // 小米平台注册的appkey,注意不要将前缀去掉 MI-appkey
  67. XIAOMI_APPID : "MI-2882303761517485829", // 小米平台注册的appid,注意不要将前缀去掉 MI-appid
  68. VIVO_APPKEY:"f3bfac7169bc3ab9d3e0c050e018d26a",
  69. VIVO_APPID:"100104950"
  70. ]
  71. multiDexEnabled true
  72. }
  73. signingConfigs {
  74. release {
  75. keyAlias 'liftmanager'
  76. keyPassword 'zhengmin123456'
  77. storeFile file('../../liftmanager.jks')
  78. storePassword 'zhengmin123456'
  79. }
  80. debug {
  81. keyAlias 'liftmanager'
  82. keyPassword 'zhengmin123456'
  83. storeFile file('../../liftmanager.jks')
  84. storePassword 'zhengmin123456'
  85. }
  86. }
  87. buildTypes {
  88. release {
  89. ndk {
  90. //这里要加上,否则debug包会出问题,后面三个为可选,x86建议加上不然部分模拟器回报错
  91. abiFilters "armeabi"
  92. // signingConfig signingConfigs.release
  93. }
  94. shrinkResources true
  95. minifyEnabled true
  96. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  97. // Signing with the debug keys for now, so `flutter run --release` works.
  98. signingConfig signingConfigs.release
  99. }
  100. debug {
  101. ndk {
  102. //这里要加上,否则debug包会出问题,后面三个为可选,x86建议加上不然部分模拟器回报错
  103. abiFilters "armeabi", "armeabi-v7a","arm64-v8a", "x86"
  104. }
  105. signingConfig signingConfigs.release
  106. }
  107. }
  108. }
  109. flutter {
  110. source '../..'
  111. }
  112. dependencies {
  113. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  114. testImplementation 'junit:junit:4.12'
  115. androidTestImplementation 'androidx.test:runner:1.1.1'
  116. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  117. implementation project(":libs")
  118. implementation 'cn.jiguang.sdk.plugin:xiaomi:4.0.6'//版本号和对应的JPush版本号相同
  119. implementation 'com.huawei.hms:push:5.0.2.300'
  120. //引入极光-华为插件,如果采用此配置,无需拷贝jpush-android-plugin-huawei-v3.x.x.jar文件,也无需配置cn.jpush.android.service.PluginHuaweiPlatformsService组件
  121. implementation 'cn.jiguang.sdk.plugin:huawei:4.0.6'
  122. implementation 'cn.jiguang.sdk.plugin:vivo:4.0.6'
  123. }