Go to the documentation to learn how to Fix dependency resolution errors.
plugins {
id 'com.android.application'
id 'kotlin-android'
id "kotlin-parcelize"
// use kotlin-parcelize by ext.kotlin_version >= 1.4.20
id "kotlin-kapt"
id "com.google.gms.google-services"
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
signingConfigs {
aoetek {
storeFile file(projectDir.absolutePath + "/aoetek.jks")
storePassword ""
keyAlias "key0"
keyPassword ""
}
}
defaultConfig {
applicationId "com.qbay.customer"
minSdkVersion 25
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
abortOnError false
checkReleaseBuilds false
disable "MissingTranslation", "GoogleAppIndexingWarning"
disable "SetTextI18n", "AllowBackup"
}
buildTypes {
all {
buildConfigField("Long", "BUILD_CURRENT_TIME_MILLIS", "${System.currentTimeMillis()}L")
}
release {
manifestPlaceholders = [appLabel: "QbayC"]
ndk {
abiFilters "arm64-v8a", "armeabi-v7a"
}
minifyEnabled true
shrinkResources true
zipAlignEnabled true
debuggable false
jniDebuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.aoetek
}
debug {
applicationIdSuffix ".dev"
versionNameSuffix '-DEBUG'
manifestPlaceholders = [appLabel: "QbayC-Dev"]
signingConfig signingConfigs.aoetek
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
dataBinding true
// https://developer.android.com/topic/libraries/data-binding
viewBinding true
// https://developer.android.com/topic/libraries/view-binding
}
}
dependencies {
// kotlin core
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// Plugin version (x.x.x) is not the same as library version (y.y.y)
// this is a android studio lint bug, do not care
// kotlin 协程
// https://developer.android.com/kotlin/coroutines
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1"
// https://github.com/junit-team/junit4/wiki/Getting-started
testImplementation 'junit:junit:4.13.1'
// https://developer.android.com/training/testing/junit-rules
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// https://developer.android.com/training/testing/espresso
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// ktx
// https://developer.android.com/kotlin/ktx
implementation "androidx.core:core-ktx:1.3.2"
implementation "androidx.fragment:fragment-ktx:1.2.5"
implementation "androidx.activity:activity-ktx:1.1.0"
// new ui
implementation "androidx.appcompat:appcompat:1.2.0"
implementation "com.google.android.material:material:1.2.1"
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
// recyclerview+Adapter
// https://github.com/CymChad/BaseRecyclerViewAdapterHelper
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.6"
// https://developer.android.com/topic/libraries/architecture/lifecycle
def lifecycle_version = "2.2.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
// implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
// implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
// 网络访问框架
// https://square.github.io/retrofit/
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
// okhttp3网络调试工具
// https://github.com/facebook/stetho
implementation "com.facebook.stetho:stetho:1.5.1"
implementation "com.facebook.stetho:stetho-okhttp3:1.5.1"
// 持久化数据
// https://github.com/Tencent/MMKV/blob/master/readme_cn.md
implementation "com.tencent:mmkv-static:1.2.4"
// 状态栏适配工具
// https://github.com/gyf-dev/ImmersionBar
implementation "com.gyf.immersionbar:immersionbar:3.0.0"
implementation "com.gyf.immersionbar:immersionbar-ktx:3.0.0"
// 工具集合类
// https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/README-CN.md
implementation "com.blankj:utilcodex:1.30.4"
// 权限请求工具
// https://github.com/guolindev/PermissionX
implementation "com.permissionx.guolindev:permissionx:1.4.0"
// 防抖节流
// https://github.com/LDRAlighieri/Corbind
implementation "ru.ldralighieri.corbind:corbind:1.4.0"
// activity回调
// https://github.com/afollestad/inline-activity-result
implementation "com.afollestad.inline-activity-result:core:0.2.0"
implementation "com.afollestad.inline-activity-result:coroutines:0.2.0"
// 图片加载库
// https://muyangmin.github.io/glide-docs-cn/
implementation "com.github.bumptech.glide:glide:4.11.0"
implementation "com.github.bumptech.glide:okhttp3-integration:4.11.0"
kapt "com.github.bumptech.glide:compiler:4.11.0"
// firebase: 消息推送
// https://firebase.google.com/docs/cloud-messaging/android/first-message
implementation platform("com.google.firebase:firebase-bom:26.0.0")
implementation "com.google.firebase:firebase-messaging-directboot:21.0.0"
implementation "com.google.firebase:firebase-messaging-ktx"
implementation "com.google.firebase:firebase-analytics-ktx"
// 二维码扫描
// https://github.com/zxing/zxing
implementation 'com.google.zxing:core:3.4.1'
// 仅限日本境内支付-paypay
// https://github.com/paypay/paypayopa-sdk-java
implementation("jp.ne.paypay:paypayopa:0.9.0") {
// exclude group: 'javax.validation', module: "validation-api"
// exclude group: 'org.glassfish', module: "javax.el"
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.20"
/**
* 当在境外网络构建时, 例如github actions, 可以不使用阿里云镜像
*/
ext.is_zh_CN_env = (Locale.getDefault().language == "zh" && Locale.getDefault().country == "CN")
repositories {
if (is_zh_CN_env) {
maven { url "https://maven.aliyun.com/repository/public/" }
maven { url "https://maven.aliyun.com/repository/google" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
println("buildscript.repositories use aliyun repository")
} else {
println("buildscript.repositories not use aliyun repository")
}
google()
jcenter()
mavenLocal()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "com.google.gms:google-services:4.3.4"
}
}
allprojects {
repositories {
if (is_zh_CN_env) {
maven { url "https://maven.aliyun.com/repository/public/" }
maven { url "https://maven.aliyun.com/repository/google" }
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
println("buildscript.repositories use aliyun repository")
} else {
println("buildscript.repositories not use aliyun repository")
}
google()
jcenter()
mavenLocal()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
implementation("jp.ne.paypay:paypayopa:0.9.0") {
exclude group: 'javax.validation', module: "validation-api"
exclude group: 'org.glassfish', module: "javax.el"
}
com.android.tools.r8.a: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)