Gradle插件3.6.1,分发URL版本5.6.4中的Gradle构建错误

时间:2020-03-19 09:12:23

标签: android android-studio gradle android-gradle-plugin build.gradle

构建项目时出现此错误

groovy.lang.MissingMethodException: No signature of method: org.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultDirectoryVar.toPath() is applicable for argument types: () values: []

我的gradle脚本看起来像这样

newApkName = "${appName}${separator}${output.baseName}${separator}${variant.versionName}.apk" def relativeRootDir = output.packageApplication.outputDirectory.toPath() .relativize(rootDir.toPath()).toFile()

似乎toPath()方法签名已更改。请帮助

1 个答案:

答案 0 :(得分:0)

通过解决此问题中的Chris Parker's advice,我能够解决此问题:variantOutput.getPackageApplication() is obsolete