Gradle发出警告:
我的build.gradle文件中没有“编译”配置,为什么它会向我发出此警告?
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'realm-android'
android {
compileSdkVersion 25
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.ktoi.toi"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
kapt {
generateStubs = true
}
buildscript {
ext.supportVersion = '25.0.0'
ext.daggerVersion = '2.7'
ext.retrofitVersion = '2.1.0'
ext.rxVersion = '1.2.1'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "io.realm:realm-gradle-plugin:2.1.1"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:25.0.0'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.android.support:cardview-v7:${supportVersion}"
implementation "com.android.support:design:${supportVersion}"
// Dagger 2
implementation "com.google.dagger:dagger:${daggerVersion}"
kapt "com.google.dagger:dagger-compiler:${daggerVersion}"
compileOnly "org.glassfish:javax.annotation:3.1.1"
//Retrofit 2
implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
implementation "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}"
implementation "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
implementation 'com.google.code.gson:gson:2.8.0'
implementation "io.reactivex:rxjava:${rxVersion}"
implementation "io.reactivex:rxandroid:${rxVersion}"
implementation 'com.github.bumptech.glide:glide:3.7.0'
}
repositories {
mavenCentral()
}
最佳答案
realm-gradle-plugin:2.1.1
较旧,old versions of the plugin add compile
dependencies。较新版本的插件正确add api
dependencies in place of compile
if your project has those。
截至目前,5.8.0是bintray的最新版本。