def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" // 导入MobSDK apply plugin: 'com.mob.sdk' MobSDK { appKey "30dc33054b635" appSecret "396e98c293130c9976fb7428b6b434d6" SecVerify {} SMSSDK {} } android { compileSdkVersion 28 lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "cn.zhios.zhiying" minSdkVersion 19 targetSdkVersion 28 aaptOptions.cruncherEnabled = false aaptOptions.useNewCruncher = false multiDexEnabled true versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } signingConfigs{ release { storeFile file("zhiying.jks") storePassword "zhioscom" keyAlias "zysh" keyPassword "zhioscom" v1SigningEnabled true v2SigningEnabled true } } flavorDimensions "app" buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' signingConfig signingConfigs.release } debug { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' signingConfig signingConfigs.release } } dexOptions { //最大堆内存 javaMaxHeapSize "4g"//4g //使用增量模式构建 incremental true //是否支持大工程模式 jumboMode = true //预编译 preDexLibraries = false //线程数 threadCount = 8 } } flutter { source '../..' } dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' }