apply plugin: 'com.android.application' def releaseTime() { return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC")) } buildscript { ext { appId = 'com.ftw.im.junyou' // app的包名, channel = 'client' // bugly上显示的渠道名, buglyAppId = '3062b077ab' // bugly配置的appId, baiduApiKey = '2vlM2itABnPcKg8CWOvKcKY1g19tjfko' // baidu配置的apiKey, googleApiKey = 'AIzaSyABu5gPAX0xzT1uw-W2q8XKQxxnEBNXSK8' // google地图配置的apiKey, huaweiAppId = '100871407' // 华为推送配置的appId, xiaomiAppId = '2882303761518030500' // 小米推送配置的appId, xiaomiAppKey = '5671803053500' // 小米推送配置的appKey, meizuAppId = '121401' // 魅族推送配置的appId, meizuAppKey = '041187021368448a93e4f39e7d0eb3b5' // 魅族推送配置的appKey, vivoAppId = '12982' // VIVO推送配置的appId, vivoAppKey = '2f5463ff-31fe-404b-a1b7-3eec2f3790a0' // VIVO推送配置的appKey, oppoAppKey = 'e532308602074e408c2b1b7d850d96e1' // OPPO推送配置的appKey, oppoAppSecret = '8e0b3c7b4a7d492390046a158bfccc44' // OPPO推送配置的secret, wechatAppId = 'wx0699fbc4666ab6e3' // 微信相关的appId, qqAppId = '101884630' // QQ相关的appId, buglyAppChannel = channel date = new Date().format("yyyyMMdd") buglyVersionNameSuffix = '' + '-' + date } } // 判断存在谷歌服务配置文件才启用谷歌服务, //def googleJson = file('google-services.json') //if (googleJson.exists() && googleJson.readLines().any { it.contains(appId) }) { // apply plugin: 'com.google.gms.google-services' // // 谷歌服务4.2版本有已知bug会导致其他无关依赖(smack4.3.4)莫名冲突,禁用相关检查解决, // // https://github.com/invertase/react-native-firebase/issues/1676 // //noinspection UnnecessaryQualifiedReference // com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true //} android { lintOptions { abortOnError false checkReleaseBuilds false } packagingOptions { exclude 'META-INF/*.kotlin_module' } compileSdkVersion compile_version defaultConfig { applicationId appId versionCode 100 versionName "1.0.0" minSdkVersion min_version targetSdkVersion target_version ndk { abiFilters "armeabi", "armeabi-v7a", "x86" // abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64" } testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled = true buildConfigField('String', "BUGLY_APP_ID", '"' + buglyAppId + '"') buildConfigField('String', "BUGLY_APP_CHANNEL", '"' + buglyAppChannel + '"') buildConfigField('String', "XIAOMI_APP_ID", '"' + xiaomiAppId + '"') buildConfigField('String', "XIAOMI_APP_KEY", '"' + xiaomiAppKey + '"') buildConfigField('String', "MEIZU_APP_ID", '"' + meizuAppId + '"') buildConfigField('String', "MEIZU_APP_KEY", '"' + meizuAppKey + '"') buildConfigField('String', "OPPO_APP_KEY", '"' + oppoAppKey + '"') buildConfigField('String', "OPPO_APP_SECRET", '"' + oppoAppSecret + '"') buildConfigField('String', "GOOGLE_API_KEY", '"' + googleApiKey + '"') buildConfigField('String', "WECHAT_APP_ID", '"' + wechatAppId + '"') buildConfigField('String', "QQ_APP_ID", '"' + qqAppId + '"') manifestPlaceholders = [ APP_ID : appId, BAIDU_API_KEY : baiduApiKey, VIVO_APP_ID : vivoAppId, VIVO_APP_KEY : vivoAppKey, GOOGLE_API_KEY: googleApiKey, HUAWEI_APP_ID : huaweiAppId, QQ_APP_ID : qqAppId, JPUSH_PKGNAME : appId, JPUSH_APPKEY : "247d5f7506b27d1fb4d0d373", //JPush上注册的包名对应的appkey. JPUSH_CHANNEL : "developer-default" //暂时填写默认值即可. ] resConfigs "en", "zh-rCN", "zh-rTW", "vi", "th", "in" } packagingOptions { pickFirst 'lib/*/libc++_shared.so' } // 高版本as中installRelease不会依赖assembleRelease也就不会复制apk, afterEvaluate { // 没配置签名的话,就没有installRelease, if (tasks.findByName('installRelease')) { installRelease.dependsOn 'assembleRelease' } } // multiDex的一些相关配置,这样配置可以让你的编译速度更快 dexOptions { // 让它不要对Lib做preDexing preDexLibraries = false // 开启incremental dexing,优化编译效率,这个功能android studio默认是关闭的 // incremental true // 增加java堆内存大小 javaMaxHeapSize "4g" } // 单元测试用, testOptions { unitTests.returnDefaultValues = true } // 进行JAVA 的版本配置,使用对应版本的一些新特性 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } useLibrary 'org.apache.http.legacy' packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } bundle { // 是否分割多语言包 language { enableSplit = false } // 是否分割资源 density { enableSplit = true } // 是否分割二进制 so 包资源 abi { enableSplit = true } } signingConfigs { debug { storeFile file('debug.keystore')//签名文件路径 } release { // storeFile file('debug.keystore')//签名文件路径 // keyAlias "androiddebugkey" // keyPassword "android" // storePassword "android" keyAlias "${KEY_ALIAS}" keyPassword "${KEY_PASSWORD}" storeFile file("${STORE_FILE}") storePassword "${STORE_PASSWORD}" } } buildTypes { debug { signingConfig signingConfigs.release // //是否混淆 // minifyEnabled true // //Zipalign优化 // zipAlignEnabled true // //清除未使用的资源 // shrinkResources true //混淆文件 // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { //是否混淆 // minifyEnabled true //Zipalign优化 zipAlignEnabled true //清除未使用的资源 // shrinkResources true //混淆文件 // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' //签名 signingConfig signingConfigs.release //gradle 3.0后使用这行代码 android.applicationVariants.all { variant -> variant.outputs.all { if (variant.buildType.name.equals('release')) { outputFileName = "jixin_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${releaseTime()}_release.apk" } else { outputFileName = "jixin_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${releaseTime()}_debug.apk" } } } } } buildToolsVersion = '28.0.3' } configurations.all { resolutionStrategy.eachDependency { details -> // jitsi和imaging两个库都依赖fresco版本冲突了, if (details.requested.group == 'com.facebook.fresco') { details.useVersion '2.0.0' } } } dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' // 1.1.0会导致安卓5上webview崩溃,https://stackoverflow.com/a/58131421 // 准确说是低版本webView的bug,普遍存在国产安卓5上, //noinspection GradleDependency implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'com.google.android.material:material:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0' implementation 'androidx.gridlayout:gridlayout:1.0.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.multidex:multidex:2.0.1' implementation 'com.squareup.okhttp3:okhttp:3.2.0' implementation 'com.github.bumptech.glide:glide:3.7.0' implementation 'de.greenrobot:eventbus:3.0.0-beta1' implementation files('libs/android-async-http-1.4.5.jar') // implementation files('libs/BaiduLBS_Android.jar') implementation files('libs/fastjson-1.2.40.jar') implementation files('libs/httpmime-4.2.jar') implementation files('libs/nineoldandroids.jar') implementation files('libs/ormlite-android-4.48.jar') implementation files('libs/ormlite-core-4.48.jar') implementation files('libs/pinyin4j-2.5.0.jar') implementation files('libs/universal-image-loader-1.9.0.jar') // QQ登录, implementation files('libs/open_sdk_r6199_lite.jar') // 微信支付/分享, implementation 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:1.0.2' // 支付宝 SDK AAR 包所需的配置 implementation files('libs/alipaySdk-15.5.9-20181123210601.aar') // 小米推送, implementation files('libs/MiPush_SDK_Client_3_6_18.jar') // 华为推送, implementation 'com.huawei.android.hms:push:2.5.2.300' implementation 'com.huawei.android.hms:base:2.5.2.300' // 魅族推送, implementation 'com.meizu.flyme.internet:push-internal:3.8.1@aar' // vivo推送, implementation files('libs/vivopushsdk_v2.3.4.jar') // oppo推送, implementation files('libs/mcssdk-1.0.1.jar') // firebase, implementation 'com.google.firebase:firebase-core:16.0.9' implementation 'com.google.firebase:firebase-messaging:18.0.0' // 下拉刷新、视频播放、扫一扫 implementation project(':pullToRefershLibraryMy') implementation project(':jcvideoplayer-lib') implementation project(':YZxing-lib') // 拍照录像 // implementation project(path: ':cameralibrary') // implementation project(path: ':filterlibrary') implementation project(':OpenGLlibrary') // 音视频 implementation project(':meeting') // 音视频使用jwt传递用户信息, implementation 'io.jsonwebtoken:jjwt:0.9.1' // 谷歌地图 // 谷歌服务版本15依赖support-v4版本26 // implementation 'com.google.android.gms:play-services-maps:16.1.0' // implementation 'com.google.android.gms:play-services-location:16.0.0' // 协议 protobuf socket implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.6.1' implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.6.1' // 视频缓存 + 视频处理 implementation 'com.danikula:videocache:2.7.1' implementation 'com.github.yangjie10930:EpMedia:v0.9.5' // 图片压缩 implementation 'top.zibin:Luban:1.1.3' // Bitmap二级缓存库 implementation('com.github.chrisbanes.bitmapcache:library:2.3') { exclude group: 'com.google.android', module: 'support-v4' } // 数据库调试库,仅限debug包生效, implementation 'androidx.legacy:legacy-support-v4:1.0.0' debugImplementation 'com.amitshekhar.android:debug-db:1.0.6' // bugly上报,没配置自动上传mapping,因为测试时自动上传mapping失败, implementation 'com.tencent.bugly:crashreport:2.6.6' // HTML解析器 implementation 'org.jsoup:jsoup:1.10.3' // 角标 implementation "me.leolin:ShortcutBadger:1.1.22" // 图片编辑库 implementation 'cc.aoeiuv020:imaging:1.0' // 流式布局 implementation 'com.hyman:flowlayout-lib:1.1.2' // 带header和footer的GridView implementation 'in.srain.cube:grid-view-with-header-footer:1.0.12' // 仿ios按钮 implementation 'com.github.zcweng:switch-button:0.0.3@aar' // 带数字的进度条 implementation 'com.daimajia.numberprogressbar:library:1.4@aar' // 靠谱点的圆形视图库 implementation 'com.makeramen:roundedimageview:2.3.0' implementation files('libs/xjgarsdklibrary-release-9.2.1-2019-08-31.aar') // 表格面板视图,https://github.com/ceryle/FitGridView implementation 'com.github.ceryle:FitGridView:v1.0.5' // 仿ios右划返回上一页, implementation 'me.imid.swipebacklayout.lib:library:1.1.0' // 支持侧滑的recyclerView, implementation project(':swiperecyclerview') // 下拉刷新布局, implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-28' // 密码学库,加密算法用到, implementation 'org.bouncycastle:bcprov-jdk15on:1.57' implementation 'cn.jiguang.sdk:jpush:3.1.1' implementation 'cn.jiguang.sdk:jcore:1.1.9' implementation 'com.huangyz0918:androidwm-light:0.1.2' implementation project(path: ':cockroach') implementation 'com.airbnb.android:lottie:3.4.0' implementation 'com.jakewharton:butterknife:10.1.0' annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46' implementation 'com.github.paradoxie:AutoVerticalTextview:0.1' implementation 'me.xuexuan:emoji-rain:1.0.0' implementation 'com.android.support:support-dynamic-animation:27.1.1' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0' implementation 'com.squareup.retrofit2:retrofit:2.6.1' implementation 'com.squareup.retrofit2:converter-gson:2.6.1' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.1' implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1' implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'//okhttplog implementation 'com.androidkun:XTabLayout:1.1.3' implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0' implementation 'com.klinkerapps:link_builder:2.0.5' implementation 'com.zzhoujay.richtext:richtext:3.0.7' implementation 'com.zzhoujay:html:1.0.1' implementation project(':wheelsruflibrary') //转盘 } configurations { all*.exclude group: 'xpp3', module: 'xpp3' }