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' } def signingConfigKeyAlias = localProperties.getProperty("signingConfig.keyAlias") if (signingConfigKeyAlias == null) { signingConfigKeyAlias = '' } def signingConfigKeyPassword = localProperties.getProperty("signingConfig.keyPassword") if (signingConfigKeyPassword == null) { signingConfigKeyPassword = '' } def signingConfigStoreFilePath = localProperties.getProperty("signingConfig.storeFilePath") if (signingConfigStoreFilePath == null) { signingConfigStoreFilePath = '' } def signingConfigStorePassword = localProperties.getProperty("signingConfig.storePassword") if (signingConfigStorePassword == null) { signingConfigStorePassword = '' } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" //[huawei4] // apply plugin: 'com.huawei.agconnect' android { // compileSdkVersion flutter.compileSdkVersion compileSdkVersion 34 ndkVersion flutter.ndkVersion compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = '1.8' } sourceSets { main.java.srcDirs += 'src/main/kotlin' } signingConfigs { release { v1SigningEnabled true v2SigningEnabled true keyAlias signingConfigKeyAlias keyPassword signingConfigKeyPassword storeFile file(signingConfigStoreFilePath) storePassword signingConfigStorePassword } debug { v1SigningEnabled true v2SigningEnabled true keyAlias signingConfigKeyAlias keyPassword signingConfigKeyPassword storeFile file(signingConfigStoreFilePath) storePassword signingConfigStorePassword } } defaultConfig { applicationId "net.zoneland.x.bpm.mobile.v1.zone_jgjs" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion 21 //flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName ndk { //选择要添加的对应 cpu 类型的 .so 库。 abiFilters 'armeabi-v7a', 'x86_64', 'arm64-v8a' } manifestPlaceholders = [ JPUSH_PKGNAME : applicationId, JPUSH_APPKEY : "9aca7cc20fe0cc987cd913ca", // NOTE: JPush 上注册的包名对应的 Appkey. JPUSH_CHANNEL : "o2oa_flutter_channel", //暂时填写默认值即可. //[xiaomi2] //[xiaomi3] //[oppo1] //[oppo2] //[oppo3] //[vivo1] //[vivo2] ] } buildTypes { debug { signingConfig signingConfigs.release } release { signingConfig signingConfigs.release // 开启删除无用资源打包后可能导致apk无法加载TBS内核库失败 //关闭删除无用资源 shrinkResources false //关闭删除无用代码 zipAlignEnabled true minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } flutter { source '../..' } dependencies { implementation fileTree(include: ['*.jar','*.aar'], dir: 'libs') implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" //[huawei5] // implementation 'com.huawei.hms:push:6.12.0.300' //[huawei6] // implementation 'cn.jiguang.sdk.plugin:huawei:5.2.0' //[xiaomi1] // implementation 'cn.jiguang.sdk.plugin:xiaomi:5.2.0' //[oppo4] // implementation 'cn.jiguang.sdk.plugin:oppo:5.2.0' //[oppo5] // implementation 'com.google.code.gson:gson:2.6.2' //[oppo6] // implementation 'commons-codec:commons-codec:1.6' //[oppo7] // implementation 'androidx.annotation:annotation:1.1.0' //[vivo3] // implementation 'cn.jiguang.sdk.plugin:vivo:5.2.0.a' }