ProcessException:进程“C:\ Users \ feye \ AndroidStudioProjects \ myproject \ android \ gradlew.bat”异常退出:
Configure project :app WARNING: API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getMergeAssets(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information. WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information. Command: C:\Users\feye\AndroidStudioProjects\myproject\android\gradlew.bat app:properties
错误结束:请检查android /文件夹中的Gradle项目设置。
build.gradle
buildscript {
ext.kotlin_version = '1.2.51'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
}
}
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
compileJava.options.fork = true
compileJava.options.forkOptions.executable = /usr/lib/jvm/java-8-openjdk-amd6
4
gradle.wraper.properties
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
最佳答案
将build.gradle中的kotlin版本更新为最新版本。
ext.kotlin_version =' 1.3.61 '
关于gradle - 使用Lateast gradle获取此警告:API 'variant.getMergeAssets()'已过时,已被 'variant.getMergeAssetsProvider()'取代,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58993921/