Java 如何解决这个问题;配置';编译';已过时,并已替换为';实施';和';api'&引用;
当我尝试使用GitHub的问题时。我屈服了 配置“compile”已过时,已替换为 “实现”和“api” 我尝试使用材质日历视图 我的格拉德尔:Java 如何解决这个问题;配置';编译';已过时,并已替换为';实施';和';api'&引用;,java,android,github,android-gradle-plugin,Java,Android,Github,Android Gradle Plugin,当我尝试使用GitHub的问题时。我屈服了 配置“compile”已过时,已替换为 “实现”和“api” 我尝试使用材质日历视图 我的格拉德尔: 您可以更改此行compile'com.applandeo:material calendar view:1.5.1' 对于此实现'com.applandeo:material calendar view:1.5.1'您可以更改此行编译'com.applandeo:material calendar view:1.5.1' 对于此实现'com.appla
您可以更改此行
compile'com.applandeo:material calendar view:1.5.1'
对于此
实现'com.applandeo:material calendar view:1.5.1'
您可以更改此行编译'com.applandeo:material calendar view:1.5.1'
对于此
实现'com.applandeo:material calendar view:1.5.1'
在更高的gradle版本中compile
被api
和implementation
替换
api
将依赖项公开给外部模块,就像compile
那样。因此,如果模块A
依赖于模块B
,而模块B
依赖于C
,如果C
发生变化,则需要重新编译A
。Gradle团队认识到这在很多情况下是不必要的,因此它引入了实现
,因此如果C
更改,则只有依赖于它的模块必须重新编译,这意味着只有模块B
。这缩短了构建时间,使项目更加整洁
简而言之,如果用api
替换所有compile
,结果将是相同的,这就是警告的目的
但是,根据经验,您可能希望尽可能使用实现
,以避免依赖性污染项目
我会尝试首先用实现
替换编译
,然后构建项目
这对差异有了更好的解释和可视化。在以后的gradle版本中,
compile
被api
和实现
取代
api
将依赖项公开给外部模块,就像compile
那样。因此,如果模块A
依赖于模块B
,而模块B
依赖于C
,如果C
发生变化,则需要重新编译A
。Gradle团队认识到这在很多情况下是不必要的,因此它引入了实现
,因此如果C
更改,则只有依赖于它的模块必须重新编译,这意味着只有模块B
。这缩短了构建时间,使项目更加整洁
简而言之,如果用api
替换所有compile
,结果将是相同的,这就是警告的目的
但是,根据经验,您可能希望尽可能使用实现
,以避免依赖性污染项目
我会尝试首先用实现
替换编译
,然后构建项目
这对差异有更好的解释和可视化
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.mederov.timelord"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile 'com.applandeo:material-calendar-view:1.5.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
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.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.4.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
}