build.gradle 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. id 'com.huawei.agconnect'
  7. }
  8. android {
  9. namespace = "com.trace.location"
  10. compileSdk = rootProject.ext.compileSdkVersion
  11. ndkVersion = rootProject.ext.ndkVersion
  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. configurations.configureEach {
  20. resolutionStrategy {
  21. // don't cache changing modules at all
  22. cacheChangingModulesFor 10, 'seconds'
  23. }
  24. }
  25. defaultConfig {
  26. applicationId = rootProject.ext.applicationId
  27. minSdk = rootProject.ext.minSdkVersion
  28. targetSdk = rootProject.ext.targetSdkVersion
  29. versionCode = flutter.versionCode
  30. versionName = flutter.versionName
  31. ndk {
  32. //noinspection ChromeOsAbiSupport
  33. abiFilters "arm64-v8a"
  34. }
  35. manifestPlaceholders = [
  36. JPUSH_PKGNAME: rootProject.ext.applicationId,
  37. JPUSH_APPKEY : "cd602bd396037438bb9ead5a", // NOTE: JPush 上注册的包名对应的 Appkey.
  38. JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
  39. HONOR_APPID : "104506963",//荣耀
  40. XIAOMI_APPKEY : "5972042933453",// 小米平台注册的appkey,xiaomi-v5.5.3版本开始,不需要添加前缀 “MI-”
  41. XIAOMI_APPID : "2882303761520429453", // 小米平台注册的appid,xiaomi-v5.5.3版本开始,不需要添加前缀 “MI-”
  42. VIVO_APPKEY : "5c8095077aa3b1a4ac9843be810f87b9", // VIVO平台注册的appkey
  43. VIVO_APPID : "105921618", // VIVO平台注册的appid
  44. OPPO_APPKEY : "OP-c6415c75cb8e4b078bafcd8500bcb017", // OPPO平台注册的appkey
  45. OPPO_APPID : "OP-33499095", // OPPO平台注册的appid
  46. OPPO_APPSECRET: "OP-f3eab24d5d5047e6a18d7151b52f5334"//OPPO平台注册的appsecret
  47. ]
  48. }
  49. signingConfigs {
  50. location {
  51. storeFile file("keystore/location.jks")
  52. storePassword "location888"
  53. keyAlias "location"
  54. keyPassword "location888"
  55. }
  56. }
  57. buildTypes {
  58. debug {
  59. // Note: The debug build type must have the same signing config as the main build type.
  60. signingConfig signingConfigs.location
  61. }
  62. release {
  63. // TODO: Add your own signing config for the release build.
  64. // Signing with the debug keys for now, so `flutter run --release` works.
  65. minifyEnabled true
  66. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  67. signingConfig signingConfigs.location
  68. }
  69. }
  70. applicationVariants.configureEach { variant ->
  71. def date = new Date().format("YYMMddHHmmss")
  72. variant.outputs.configureEach {
  73. def fileName = "${defaultConfig.applicationId}" +
  74. "-v${defaultConfig.versionName}" +
  75. "-${variant.buildType.name}" +
  76. "-${date}" +
  77. ".apk"
  78. outputFileName = fileName
  79. }
  80. }
  81. repositories {
  82. flatDir {
  83. dirs 'libs'
  84. }
  85. }
  86. }
  87. flutter {
  88. source = "../.."
  89. }
  90. dependencies {
  91. //引入 libs 中的 aar,如果项目中有此依赖不需要重复引用
  92. implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
  93. // 接入荣耀厂商
  94. implementation 'cn.jiguang.sdk.plugin:honor:5.8.0'
  95. //小米
  96. implementation 'cn.jiguang.sdk.plugin:xiaomi:5.8.0'
  97. // 接入华为厂商
  98. implementation 'com.huawei.hms:push:6.13.0.300'
  99. implementation 'cn.jiguang.sdk.plugin:huawei:5.8.0'
  100. // 接入 OPPO 厂商
  101. implementation 'cn.jiguang.sdk.plugin:oppo:5.8.0'
  102. //以下为 OPPO 3.1.0 aar需要依赖
  103. implementation 'com.google.code.gson:gson:2.10.1'
  104. implementation 'commons-codec:commons-codec:1.6'
  105. implementation 'androidx.annotation:annotation:1.1.0'
  106. //vivo
  107. implementation 'cn.jiguang.sdk.plugin:vivo:5.8.0'
  108. }