无法找到com.android.build.gradle.internal.api.ApplicationVariantImpl财产“OUTPUTFILE”财产、build、gradle、com

由网友(把柄)分享简介:更新到1.0 RC 1和插件后0.14.4我有问题,我的build.gradle的重命名部分:After updating to AS 1.0 RC 1 and plugin 0.14.4 I am having problems with the renaming part of my build.gradle:...

更新到1.0 RC 1和插件后0.14.4我有问题,我的build.gradle的重命名部分:

After updating to AS 1.0 RC 1 and plugin 0.14.4 I am having problems with the renaming part of my build.gradle:

applicationVariants.all { variant ->
            def file = variant.outputFile
            variant.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
        }

现在抛出:

Error:(78, 0) Could not find property 'outputFile' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@67e7625f.

和我也不能跳转到类ApplicationVariantImpl看怎么财产可能被重命名。 任何人都知道的解决方法呢?

and also I cannot jump to the class ApplicationVariantImpl to look how the property might have been renamed. Anyone knows workarounds for this?

推荐答案

试试这个

applicationVariants.all { variant ->
    variant.outputs.each { output ->
        def file = output.outputFile
        output.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
    }
}
阅读全文

相关推荐

最新文章