apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' //apply plugin: 'kotlin-parcelize' android { compileSdkVersion 30 // buildToolsVersion "29.0.3" defaultConfig { applicationId "com.xk_oil.enterprise" minSdkVersion 21 targetSdkVersion 30 versionCode 4 // versionName "1.0.3" versionName "1.0.1" multiDexEnabled true renderscriptSupportModeEnabled = true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" //版本名后面添加一句话,意思就是flavor dimension 它的维度就是该版本号,这样维度就是都是统一的了 flavorDimensions "versionCode" vectorDrawables.useSupportLibrary = true ndk { abiFilters "armeabi-v7a", 'arm64-v8a' } } lintOptions { checkReleaseBuilds false abortOnError false } dexOptions { preDexLibraries = false javaMaxHeapSize "4g" } aaptOptions { cruncherEnabled = false useNewCruncher = false } //为解决部分三方库重复打包META-INF的问题 packagingOptions { exclude 'META-INF/rxjava.properties' } signingConfigs { debug { keyAlias 'xk_oil' keyPassword '123456' storeFile file('E:\\pagerLso\\xk_oil.jks') storePassword '123456' } release { keyAlias 'xk_oil' keyPassword '123456' storeFile file('E:\\pagerLso\\xk_oil.jks') storePassword '123456' } } buildTypes { debug { minifyEnabled false //是否优化zip zipAlignEnabled true shrinkResources false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } release { minifyEnabled false //是否优化zip zipAlignEnabled true minifyEnabled false shrinkResources false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } } buildFeatures{ dataBinding = true // for view binding : // viewBinding = true } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } productFlavors { pro { applicationId "com.xk_oil.enterprise" manifestPlaceholders = [APP_NAME : "星油", PROVIDER : "com.xk_oil.enterprise.fileprovider", GAODE_APP_KEY: "fb7b73ae37f80435738c11f6f1ff7adf"] //生产环境阿里云 buildConfigField "String", "baseUrl", '"http://www.xingoil.com/adminapi/"' // buildConfigField "String", "baseUrl", '"http://uat.xingoil.com/adminapi/"' //三方生产环境 buildConfigField "String", "baseUrl_Third", '"http://thr.xingkaserver.cn:8085/"' } dev { applicationId "com.xk_oil.enterprise" manifestPlaceholders = [APP_NAME : "星油测试", PROVIDER : "com.xk_oil.enterprise.fileprovider", GAODE_APP_KEY: "fb7b73ae37f80435738c11f6f1ff7adf"] buildConfigField "String", "baseUrl", '"http://192.168.0.45:38080/"' //阿浩 // buildConfigField "String", "baseUrl", '"http://192.168.0.150:38080/"' // buildConfigField "String", "baseUrl", '"http://121.196.213.68/adminapi/"' // buildConfigField "String", "baseUrl", '"http://192.168.0.47:38080/"' //三方测试环境 buildConfigField "String", "baseUrl_Third", '"http://192.168.0.140:8087/"' } } //打包命名 android.applicationVariants.all { variant -> variant.outputs.all { output -> //def date = new Date().format("yyyyMMdd" , TimeZone.getTimeZone("Asia/Shanghai")) def date = new Date().format("yyyyMMdd", TimeZone.getTimeZone("GMT+08")) if (variant.buildType.name.equals('debug')) { outputFileName = "${variant.buildType.name}-${date}-${variant.versionName}.apk" } if (variant.buildType.name.equals('release')) { outputFileName = "${variant.buildType.name}-${date}-${variant.versionName}.apk" } } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') //noinspection GradleCompatible implementation 'com.android.support:design:28.0.0' //noinspection GradleCompatible implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation files('libs/umeng-common-9.3.7.jar') implementation files('libs/umeng-share-core-7.1.4.jar') implementation files('libs/umeng-share-wechat-full-7.1.4.jar') implementation files('libs/MiPush_SDK_Client_3_7_6.jar') implementation 'com.android.support:multidex:1.0.3' testImplementation 'junit:junit:4.12' //noinspection GradleCompatible androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' //项目用到的库 implementation files('libs/commons-codec-1.11.jar') implementation 'io.reactivex.rxjava2:rxjava:2.2.4' implementation 'io.reactivex.rxjava2:rxandroid:2.1.0' implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.4.0' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0' implementation 'android.arch.lifecycle:extensions:1.1.1' implementation 'android.arch.lifecycle:common-java8:1.1.1' implementation 'com.github.bumptech.glide:okhttp3-integration:4.9.0' implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.5.1' implementation 'com.orhanobut:logger:2.2.0' implementation files('libs/bcprov-jdk16-140.jar') implementation project(':promptlibrary') implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:5.1.6' implementation 'org.greenrobot:eventbus:3.1.1' implementation 'org.apache.commons:commons-lang3:3.7' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.jungly:gridPasswordView:0.3' // implementation 'com.google.android:flexbox:1.0.0' //3D地图so及jar implementation 'com.amap.api:3dmap:8.1.0' // implementation 'com.amap.api:navi-3dmap:7.9.1_3dmap7.9.1' //定位功能 implementation 'com.amap.api:location:5.3.0' implementation 'com.amap.api:search:8.1.0' //自定义车牌号 implementation 'com.parkingwang:keyboard:0.7.3' //二维码扫描 implementation 'cn.yipianfengye.android:zxing-library:2.2' implementation 'top.zibin:Luban:1.1.8' implementation 'com.contrarywind:Android-PickerView:4.1.8' implementation 'com.isseiaoki:simplecropview:1.1.8' implementation 'com.youth.banner:banner:1.4.10' implementation 'com.umeng.umsdk:asms:1.2.1'//必选 // 支付宝 SDK AAR 包所需的配置 implementation (name: 'alipaysdk-15.8.02.210308182128', ext: 'aar') implementation 'com.github.tbruyelle:rxpermissions:0.10.2' // implementation 'com.github.tbruyelle:rxpermissions:0.12' }