build.gradle 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 GradleException("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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
  22. android {
  23. signingConfigs {
  24. debug {
  25. storeFile file('/Users/Work/fast/key/android_key')
  26. storePassword 'fast2022'
  27. keyPassword 'fast2022'
  28. keyAlias 'key0'
  29. }
  30. release {
  31. storeFile file('/Users/Work/fast/key/android_key')
  32. storePassword 'fast2022'
  33. keyPassword 'fast2022'
  34. keyAlias 'key0'
  35. }
  36. }
  37. compileSdkVersion flutter.compileSdkVersion
  38. compileOptions {
  39. sourceCompatibility JavaVersion.VERSION_1_8
  40. targetCompatibility JavaVersion.VERSION_1_8
  41. }
  42. defaultConfig {
  43. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  44. applicationId "com.hye.fast"
  45. minSdkVersion 19//flutter.minSdkVersion
  46. targetSdkVersion flutter.targetSdkVersion
  47. versionCode flutterVersionCode.toInteger()
  48. versionName flutterVersionName
  49. multiDexEnabled true
  50. manifestPlaceholders = [
  51. JPUSH_PKGNAME : applicationId,
  52. JPUSH_APPKEY : "7cf918ada725a9e9aecc8a17",//值来自开发者平台取得的AppKey
  53. JPUSH_CHANNEL : "default_developer",
  54. // //meizu_config_start
  55. // MEIZU_APPKEY : "MZ-魅族的APPKEY",
  56. // MEIZU_APPID : "MZ-魅族的APPID",
  57. // //meizu_config_end
  58. // //xiaomi_config_start
  59. // XIAOMI_APPID : "MI-小米的APPID",
  60. // XIAOMI_APPKEY : "MI-小米的APPKEY",
  61. // //xiaomi_config_end
  62. // //oppo_config_start
  63. // OPPO_APPKEY : "OP-oppo的APPKEY",
  64. // OPPO_APPID : "OP-oppo的APPID",
  65. // OPPO_APPSECRET: "OP-oppo的APPSECRET",
  66. // //oppo_config_end
  67. // //vivo_config_start
  68. // VIVO_APPKEY : "vivo的APPKEY",
  69. // VIVO_APPID : "vivo的APPID",
  70. // //vivo_config_end
  71. ]
  72. }
  73. buildTypes {
  74. release {
  75. // TODO: Add your own signing config for the release build.
  76. // Signing with the debug keys for now, so `flutter run --release` works.
  77. signingConfig signingConfigs.debug
  78. }
  79. }
  80. }
  81. dependencies {
  82. implementation 'com.android.support:multidex:1.0.3'
  83. }
  84. flutter {
  85. source '../..'
  86. }