build.gradle 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. defaultConfig {
  32. applicationId "com.tyty.liftmanager"
  33. minSdkVersion 21
  34. targetSdkVersion 28
  35. versionCode flutterVersionCode.toInteger()
  36. versionName flutterVersionName
  37. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  38. ndk {
  39. //设置支持的SO库架构
  40. abiFilters 'armeabi-v7a'//, 'arm64-v8a', 'x86', 'x86_64'
  41. }
  42. manifestPlaceholders = [
  43. PACKAGE_NAME : applicationId,
  44. XG_ACCESS_ID : "2100320854",
  45. XG_ACCESS_KEY: "A7D99HE19CAX",
  46. HW_APPID : "10839500",
  47. XIAOMI_APPID : "",
  48. XIAOMI_APPKEY: "",
  49. XG_ACCESS_SCHEME:"",
  50. JPUSH_PKGNAME : applicationId,
  51. JPUSH_APPKEY : "bd76ee7fb5dac9d04b12a521", // NOTE: JPush 上注册的包名对应的 Appkey.
  52. JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
  53. ]
  54. multiDexEnabled true
  55. }
  56. signingConfigs {
  57. release {
  58. keyAlias 'liftmanager'
  59. keyPassword 'zhengmin123456'
  60. storeFile file('../../liftmanager.jks')
  61. storePassword 'zhengmin123456'
  62. }
  63. }
  64. buildTypes {
  65. release {
  66. ndk {
  67. //这里其实我觉可以直接是用"armeabi-v7a",但国内几个大哥之前使用的都是"armeabi"
  68. abiFilters "armeabi"
  69. // abiFilters "armeabi-v7a"
  70. }
  71. // Signing with the debug keys for now, so `flutter run --release` works.
  72. signingConfig signingConfigs.release
  73. }
  74. debug {
  75. ndk {
  76. //这里要加上,否则debug包会出问题,后面三个为可选,x86建议加上不然部分模拟器回报错
  77. abiFilters "armeabi", "armeabi-v7a","arm64-v8a", "x86"
  78. // signingConfig signingConfigs.release
  79. }
  80. }
  81. }
  82. }
  83. flutter {
  84. source '../..'
  85. }
  86. dependencies {
  87. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  88. testImplementation 'junit:junit:4.12'
  89. androidTestImplementation 'androidx.test:runner:1.1.1'
  90. androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  91. implementation project(":libs")
  92. }