基础库
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

107 行
2.8 KiB

  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. // 导入MobSDK
  23. apply plugin: 'com.mob.sdk'
  24. MobSDK {
  25. appKey "30dc33054b635"
  26. appSecret "396e98c293130c9976fb7428b6b434d6"
  27. SecVerify {}
  28. SMSSDK {}
  29. }
  30. android {
  31. compileSdkVersion 28
  32. lintOptions {
  33. disable 'InvalidPackage'
  34. }
  35. defaultConfig {
  36. // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
  37. applicationId "cn.zhios.zhiying"
  38. minSdkVersion 19
  39. targetSdkVersion 28
  40. aaptOptions.cruncherEnabled = false
  41. aaptOptions.useNewCruncher = false
  42. multiDexEnabled true
  43. versionCode flutterVersionCode.toInteger()
  44. versionName flutterVersionName
  45. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  46. }
  47. signingConfigs{
  48. release {
  49. storeFile file("zhiying.jks")
  50. storePassword "zhioscom"
  51. keyAlias "zysh"
  52. keyPassword "zhioscom"
  53. v1SigningEnabled true
  54. v2SigningEnabled true
  55. }
  56. }
  57. flavorDimensions "app"
  58. buildTypes {
  59. release {
  60. minifyEnabled true
  61. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
  62. signingConfig signingConfigs.release
  63. }
  64. debug {
  65. minifyEnabled false
  66. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
  67. signingConfig signingConfigs.release
  68. }
  69. }
  70. dexOptions {
  71. //最大堆内存
  72. javaMaxHeapSize "4g"//4g
  73. //使用增量模式构建
  74. incremental true
  75. //是否支持大工程模式
  76. jumboMode = true
  77. //预编译
  78. preDexLibraries = false
  79. //线程数
  80. threadCount = 8
  81. }
  82. }
  83. flutter {
  84. source '../..'
  85. }
  86. dependencies {
  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. }