123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- plugins {
- id "com.android.application"
- id "kotlin-android"
- id "kotlin-kapt"
- id "dev.flutter.flutter-gradle-plugin"
- }
- def keystoreProperties = new Properties()
- def keystorePropertiesFile = rootProject.file('key.properties')
- if (keystorePropertiesFile.exists()) {
- keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
- }
- 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 Exception("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
- }
- // 模拟器运行报错时尝试开启此项
- // project.setProperty('target-platform', 'android-arm')
- android {
- compileSdkVersion 34
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_11
- targetCompatibility JavaVersion.VERSION_11
- }
- kotlinOptions {
- jvmTarget = JavaVersion.VERSION_11
- }
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
- }
- lintOptions {
- // 如打包出现Failed to transform libs.jar to match attributes
- checkReleaseBuilds false
- }
- defaultConfig {
- applicationId "com.hongyegroup.proanperty_management"
- minSdkVersion 21
- targetSdkVersion 34
- versionCode 100 //Android打包上线记得要加固并重新签名再传
- versionName "1.0.0"
- multiDexEnabled true
- ndk {
- //选择要添加的对应 cpu 类型的 .so 库。
- abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
- abiFilters 'armeabi-v7a', 'arm64-v8a'
- // abiFilters 'armeabi-v7a'
- // abiFilters 'arm64-v8a'
- }
- manifestPlaceholders = [
- JPUSH_PKGNAME : applicationId,
- JPUSH_APPKEY : "1234567890",
- JPUSH_CHANNEL : "developer-default",
- queryAllPackages: ""
- ]
- }
- //配置keystore签名
- signingConfigs {
- release {
- keyAlias keystoreProperties['keyAlias']
- keyPassword keystoreProperties['keyPassword']
- storeFile file(keystoreProperties['storeFile'])
- storePassword keystoreProperties['storePassword']
- }
- debug {
- }
- }
- buildTypes {
- release {
- signingConfig signingConfigs.release
- //默认系统混淆
- minifyEnabled true
- // 不显示Log
- buildConfigField "boolean", "LOG_DEBUG", "false"
- //是否可调试
- debuggable false
- //Zipalign优化
- zipAlignEnabled true
- //移除无用的resource文件
- shrinkResources true
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- debug {
- signingConfig signingConfigs.release
- //是否可调试
- debuggable true
- }
- }
- }
- flutter {
- source '../..'
- }
- dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0"
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0"
- implementation 'com.github.bumptech.glide:glide:4.11.0'
- kapt 'com.github.bumptech.glide:compiler:4.11.0'
- implementation 'androidx.appcompat:appcompat:1.3.1' //加入AndroidX依赖
- implementation 'com.android.support:multidex:1.0.3'
- // implementation 'androidx.core:core-splashscreen:1.0.0' //启动12兼容
- }
|