Aas*_*ish 4 android updates android-studio javacompiler
我将Android Studio从3.0.1更新为3.1.0
但是在更新后,当我构建项目时,它显示2警告:
1.将编译替换为实现(编译支持将于2018年底终止)
2.用testImplementaion替换testCompile(并且testCompile支持将在2018年底终止)
因此,最后进行这些更改,但是之后,它显示了一些错误:
build.gradle(模块:应用)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "biz.coolpage.aashish.app"
minSdkVersion 17
targetSdkVersion 27
versionCode 4
versionName "1.2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:design:27.1.0'
implementation project(':library')
}
Run Code Online (Sandbox Code Playgroud)
build.gradle(Project:Abc)
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
尝试使用api而不是implementation在库的gradle内部。如果您有子模块并且想要以传递方式公开库,api则应使用。implementation将导入特定项目的库。另外,您可能必须添加
implementation (project(":library")) {
transitive = true
}
Run Code Online (Sandbox Code Playgroud)
例如,在build.gradle库模块的文件中使用:
api 'com.android.support:appcompat-v7:27.1.0'
Run Code Online (Sandbox Code Playgroud)
代替
implementation 'com.android.support:appcompat-v7:27.1.0'
Run Code Online (Sandbox Code Playgroud)
如果没有任何效果,您可以尝试使缓存无效并重新启动
| 归档时间: |
|
| 查看次数: |
6530 次 |
| 最近记录: |