build.gradle 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. apply plugin: 'com.android.application'
  2. def releaseTime() {
  3. return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
  4. }
  5. buildscript {
  6. ext {
  7. appId = 'com.jixin.im' // app的包名,
  8. channel = 'client' // bugly上显示的渠道名,
  9. buglyAppId = '3062b077ab' // bugly配置的appId,
  10. baiduApiKey = '2vlM2itABnPcKg8CWOvKcKY1g19tjfko' // baidu配置的apiKey,
  11. googleApiKey = 'AIzaSyABu5gPAX0xzT1uw-W2q8XKQxxnEBNXSK8' // google地图配置的apiKey,
  12. huaweiAppId = '100871407' // 华为推送配置的appId,
  13. xiaomiAppId = '2882303761518030500' // 小米推送配置的appId,
  14. xiaomiAppKey = '5671803053500' // 小米推送配置的appKey,
  15. meizuAppId = '121401' // 魅族推送配置的appId,
  16. meizuAppKey = '041187021368448a93e4f39e7d0eb3b5' // 魅族推送配置的appKey,
  17. vivoAppId = '12982' // VIVO推送配置的appId,
  18. vivoAppKey = '2f5463ff-31fe-404b-a1b7-3eec2f3790a0' // VIVO推送配置的appKey,
  19. oppoAppKey = 'e532308602074e408c2b1b7d850d96e1' // OPPO推送配置的appKey,
  20. oppoAppSecret = '8e0b3c7b4a7d492390046a158bfccc44' // OPPO推送配置的secret,
  21. wechatAppId = 'wx0699fbc4666ab6e3' // 微信相关的appId,
  22. qqAppId = '101884630' // QQ相关的appId,
  23. buglyAppChannel = channel
  24. date = new Date().format("yyyyMMdd")
  25. buglyVersionNameSuffix = '' + '-' + date
  26. }
  27. }
  28. // 判断存在谷歌服务配置文件才启用谷歌服务,
  29. //def googleJson = file('google-services.json')
  30. //if (googleJson.exists() && googleJson.readLines().any { it.contains(appId) }) {
  31. // apply plugin: 'com.google.gms.google-services'
  32. // // 谷歌服务4.2版本有已知bug会导致其他无关依赖(smack4.3.4)莫名冲突,禁用相关检查解决,
  33. // // https://github.com/invertase/react-native-firebase/issues/1676
  34. // //noinspection UnnecessaryQualifiedReference
  35. // com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
  36. //}
  37. android {
  38. lintOptions {
  39. abortOnError false
  40. checkReleaseBuilds false
  41. }
  42. compileSdkVersion compile_version
  43. defaultConfig {
  44. applicationId appId
  45. versionCode 325
  46. versionName "3.2.5"
  47. minSdkVersion min_version
  48. targetSdkVersion target_version
  49. ndk {
  50. abiFilters "armeabi", "armeabi-v7a", "x86"
  51. // abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
  52. }
  53. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  54. multiDexEnabled = true
  55. buildConfigField('String', "BUGLY_APP_ID", '"' + buglyAppId + '"')
  56. buildConfigField('String', "BUGLY_APP_CHANNEL", '"' + buglyAppChannel + '"')
  57. buildConfigField('String', "XIAOMI_APP_ID", '"' + xiaomiAppId + '"')
  58. buildConfigField('String', "XIAOMI_APP_KEY", '"' + xiaomiAppKey + '"')
  59. buildConfigField('String', "MEIZU_APP_ID", '"' + meizuAppId + '"')
  60. buildConfigField('String', "MEIZU_APP_KEY", '"' + meizuAppKey + '"')
  61. buildConfigField('String', "OPPO_APP_KEY", '"' + oppoAppKey + '"')
  62. buildConfigField('String', "OPPO_APP_SECRET", '"' + oppoAppSecret + '"')
  63. buildConfigField('String', "GOOGLE_API_KEY", '"' + googleApiKey + '"')
  64. buildConfigField('String', "WECHAT_APP_ID", '"' + wechatAppId + '"')
  65. buildConfigField('String', "QQ_APP_ID", '"' + qqAppId + '"')
  66. manifestPlaceholders = [
  67. APP_ID : appId,
  68. BAIDU_API_KEY : baiduApiKey,
  69. VIVO_APP_ID : vivoAppId,
  70. VIVO_APP_KEY : vivoAppKey,
  71. GOOGLE_API_KEY: googleApiKey,
  72. HUAWEI_APP_ID : huaweiAppId,
  73. QQ_APP_ID : qqAppId,
  74. JPUSH_PKGNAME : appId,
  75. JPUSH_APPKEY : "247d5f7506b27d1fb4d0d373", //JPush上注册的包名对应的appkey.
  76. JPUSH_CHANNEL : "developer-default" //暂时填写默认值即可.
  77. ]
  78. resConfigs "en", "zh-rCN", "zh-rTW", "vi", "th", "in"
  79. }
  80. packagingOptions {
  81. pickFirst 'lib/*/libc++_shared.so'
  82. }
  83. // 高版本as中installRelease不会依赖assembleRelease也就不会复制apk,
  84. afterEvaluate {
  85. // 没配置签名的话,就没有installRelease,
  86. if (tasks.findByName('installRelease')) {
  87. installRelease.dependsOn 'assembleRelease'
  88. }
  89. }
  90. // multiDex的一些相关配置,这样配置可以让你的编译速度更快
  91. dexOptions {
  92. // 让它不要对Lib做preDexing
  93. preDexLibraries = false
  94. // 开启incremental dexing,优化编译效率,这个功能android studio默认是关闭的
  95. // incremental true
  96. // 增加java堆内存大小
  97. javaMaxHeapSize "4g"
  98. }
  99. // 单元测试用,
  100. testOptions {
  101. unitTests.returnDefaultValues = true
  102. }
  103. // 进行JAVA 的版本配置,使用对应版本的一些新特性
  104. compileOptions {
  105. sourceCompatibility JavaVersion.VERSION_1_8
  106. targetCompatibility JavaVersion.VERSION_1_8
  107. }
  108. useLibrary 'org.apache.http.legacy'
  109. packagingOptions {
  110. exclude 'META-INF/LICENSE.txt'
  111. exclude 'META-INF/NOTICE.txt'
  112. }
  113. bundle {
  114. // 是否分割多语言包
  115. language {
  116. enableSplit = false
  117. }
  118. // 是否分割资源
  119. density {
  120. enableSplit = true
  121. }
  122. // 是否分割二进制 so 包资源
  123. abi {
  124. enableSplit = true
  125. }
  126. }
  127. signingConfigs {
  128. debug {
  129. storeFile file('debug.keystore')//签名文件路径
  130. }
  131. release {
  132. // storeFile file('debug.keystore')//签名文件路径
  133. // keyAlias "androiddebugkey"
  134. // keyPassword "android"
  135. // storePassword "android"
  136. keyAlias "${KEY_ALIAS}"
  137. keyPassword "${KEY_PASSWORD}"
  138. storeFile file("${STORE_FILE}")
  139. storePassword "${STORE_PASSWORD}"
  140. }
  141. }
  142. buildTypes {
  143. debug {
  144. signingConfig signingConfigs.release
  145. // //是否混淆
  146. // minifyEnabled true
  147. // //Zipalign优化
  148. // zipAlignEnabled true
  149. // //清除未使用的资源
  150. // shrinkResources true
  151. //混淆文件
  152. // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  153. }
  154. release {
  155. //是否混淆
  156. // minifyEnabled true
  157. //Zipalign优化
  158. zipAlignEnabled true
  159. //清除未使用的资源
  160. // shrinkResources true
  161. //混淆文件
  162. // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  163. //签名
  164. signingConfig signingConfigs.release
  165. //gradle 3.0后使用这行代码
  166. android.applicationVariants.all { variant ->
  167. variant.outputs.all {
  168. if (variant.buildType.name.equals('release')) {
  169. outputFileName = "jixin_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${releaseTime()}_release.apk"
  170. } else {
  171. outputFileName = "jixin_v${defaultConfig.versionName}_${defaultConfig.versionCode}_${releaseTime()}_debug.apk"
  172. }
  173. }
  174. }
  175. }
  176. }
  177. buildToolsVersion = '28.0.3'
  178. }
  179. configurations.all {
  180. resolutionStrategy.eachDependency { details ->
  181. // jitsi和imaging两个库都依赖fresco版本冲突了,
  182. if (details.requested.group == 'com.facebook.fresco') {
  183. details.useVersion '2.0.0'
  184. }
  185. }
  186. }
  187. dependencies {
  188. testImplementation 'junit:junit:4.12'
  189. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  190. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  191. // 1.1.0会导致安卓5上webview崩溃,https://stackoverflow.com/a/58131421
  192. // 准确说是低版本webView的bug,普遍存在国产安卓5上,
  193. //noinspection GradleDependency
  194. implementation 'androidx.appcompat:appcompat:1.0.2'
  195. implementation 'com.google.android.material:material:1.0.0'
  196. implementation 'androidx.recyclerview:recyclerview:1.0.0'
  197. implementation 'androidx.gridlayout:gridlayout:1.0.0'
  198. implementation 'androidx.cardview:cardview:1.0.0'
  199. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  200. implementation 'androidx.multidex:multidex:2.0.1'
  201. implementation 'com.squareup.okhttp3:okhttp:3.2.0'
  202. implementation 'com.github.bumptech.glide:glide:3.7.0'
  203. implementation 'de.greenrobot:eventbus:3.0.0-beta1'
  204. implementation files('libs/android-async-http-1.4.5.jar')
  205. // implementation files('libs/BaiduLBS_Android.jar')
  206. implementation files('libs/fastjson-1.2.40.jar')
  207. implementation files('libs/httpmime-4.2.jar')
  208. implementation files('libs/nineoldandroids.jar')
  209. implementation files('libs/ormlite-android-4.48.jar')
  210. implementation files('libs/ormlite-core-4.48.jar')
  211. implementation files('libs/pinyin4j-2.5.0.jar')
  212. implementation files('libs/universal-image-loader-1.9.0.jar')
  213. // QQ登录,
  214. implementation files('libs/open_sdk_r6199_lite.jar')
  215. // 微信支付/分享,
  216. implementation 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:1.0.2'
  217. // 支付宝 SDK AAR 包所需的配置
  218. implementation files('libs/alipaySdk-15.5.9-20181123210601.aar')
  219. // 小米推送,
  220. implementation files('libs/MiPush_SDK_Client_3_6_18.jar')
  221. // 华为推送,
  222. implementation 'com.huawei.android.hms:push:2.5.2.300'
  223. implementation 'com.huawei.android.hms:base:2.5.2.300'
  224. // 魅族推送,
  225. implementation 'com.meizu.flyme.internet:push-internal:3.8.1@aar'
  226. // vivo推送,
  227. implementation files('libs/vivopushsdk_v2.3.4.jar')
  228. // oppo推送,
  229. implementation files('libs/mcssdk-1.0.1.jar')
  230. // firebase,
  231. implementation 'com.google.firebase:firebase-core:16.0.9'
  232. implementation 'com.google.firebase:firebase-messaging:18.0.0'
  233. // 下拉刷新、视频播放、扫一扫
  234. implementation project(':pullToRefershLibraryMy')
  235. implementation project(':jcvideoplayer-lib')
  236. implementation project(':YZxing-lib')
  237. // 拍照录像
  238. // implementation project(path: ':cameralibrary')
  239. // implementation project(path: ':filterlibrary')
  240. implementation project(':OpenGLlibrary')
  241. // 音视频
  242. implementation project(':meeting')
  243. // 音视频使用jwt传递用户信息,
  244. implementation 'io.jsonwebtoken:jjwt:0.9.1'
  245. // 谷歌地图
  246. // 谷歌服务版本15依赖support-v4版本26
  247. // implementation 'com.google.android.gms:play-services-maps:16.1.0'
  248. // implementation 'com.google.android.gms:play-services-location:16.0.0'
  249. // 协议 protobuf socket
  250. implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.6.1'
  251. implementation group: 'com.google.protobuf', name: 'protobuf-java-util', version: '3.6.1'
  252. // 视频缓存 + 视频处理
  253. implementation 'com.danikula:videocache:2.7.1'
  254. implementation 'com.github.yangjie10930:EpMedia:v0.9.5'
  255. // 图片压缩
  256. implementation 'top.zibin:Luban:1.1.3'
  257. // Bitmap二级缓存库
  258. implementation('com.github.chrisbanes.bitmapcache:library:2.3') {
  259. exclude group: 'com.google.android', module: 'support-v4'
  260. }
  261. // 数据库调试库,仅限debug包生效,
  262. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  263. debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
  264. // bugly上报,没配置自动上传mapping,因为测试时自动上传mapping失败,
  265. implementation 'com.tencent.bugly:crashreport:2.6.6'
  266. // HTML解析器
  267. implementation 'org.jsoup:jsoup:1.10.3'
  268. // 角标
  269. implementation "me.leolin:ShortcutBadger:1.1.22"
  270. // 图片编辑库
  271. implementation 'cc.aoeiuv020:imaging:1.0'
  272. // 流式布局
  273. implementation 'com.hyman:flowlayout-lib:1.1.2'
  274. // 带header和footer的GridView
  275. implementation 'in.srain.cube:grid-view-with-header-footer:1.0.12'
  276. // 仿ios按钮
  277. implementation 'com.github.zcweng:switch-button:0.0.3@aar'
  278. // 带数字的进度条
  279. implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
  280. // 靠谱点的圆形视图库
  281. implementation 'com.makeramen:roundedimageview:2.3.0'
  282. implementation files('libs/xjgarsdklibrary-release-9.2.1-2019-08-31.aar')
  283. // 表格面板视图,https://github.com/ceryle/FitGridView
  284. implementation 'com.github.ceryle:FitGridView:v1.0.5'
  285. // 仿ios右划返回上一页,
  286. implementation 'me.imid.swipebacklayout.lib:library:1.1.0'
  287. // 支持侧滑的recyclerView,
  288. implementation project(':swiperecyclerview')
  289. // 下拉刷新布局,
  290. implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-28'
  291. // 密码学库,加密算法用到,
  292. implementation 'org.bouncycastle:bcprov-jdk15on:1.57'
  293. implementation 'cn.jiguang.sdk:jpush:3.1.1'
  294. implementation 'cn.jiguang.sdk:jcore:1.1.9'
  295. implementation 'com.huangyz0918:androidwm-light:0.1.2'
  296. implementation project(path: ':cockroach')
  297. implementation 'com.airbnb.android:lottie:3.4.0'
  298. implementation 'com.jakewharton:butterknife:10.1.0'
  299. annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
  300. implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46'
  301. implementation 'com.github.paradoxie:AutoVerticalTextview:0.1'
  302. implementation 'me.xuexuan:emoji-rain:1.0.0'
  303. implementation 'com.android.support:support-dynamic-animation:27.1.1'
  304. implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
  305. implementation 'com.squareup.retrofit2:retrofit:2.6.1'
  306. implementation 'com.squareup.retrofit2:converter-gson:2.6.1'
  307. implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.1'
  308. implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1'
  309. implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'//okhttplog
  310. implementation 'com.androidkun:XTabLayout:1.1.3'
  311. implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
  312. implementation 'com.zzhoujay.richtext:richtext:3.0.7'
  313. implementation 'com.zzhoujay:html:1.0.1'
  314. implementation project(':wheelsruflibrary') //转盘
  315. }
  316. configurations {
  317. all*.exclude group: 'xpp3', module: 'xpp3'
  318. }