应用级渐变
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'org.greenrobot.greendao'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "mydemo.com.anew"
minSdkVersion 16
targetSdkVersion 24
versionCode 120
versionName "1.2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:support-vector-drawable:27.1.0'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'org.greenrobot:greendao:3.2.2'
implementation 'com.google.firebase:firebase-ads:11.8.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
}
项目级梯度
buildscript {
repositories {
jcenter()
mavenCentral()
google()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
subprojects {
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
转到“工具”>“Kotlin”>“配置Kotlin插件更新”
jre公司
jdk公司
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
希望这对你有帮助