build.gradle 3.3 KB

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