当前位置: 首页 > 知识库问答 >
问题:

在com.android.build.gradle.internal.api.applicationvariantimpl上找不到属性“output file”

陆建木
2023-03-14

在更新到AS1.0RC1和插件0.14.4后,我在重命名部分遇到了问题。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类来查看该属性可能是如何重命名的。有人知道解决办法吗?

共有1个答案

利海阳
2023-03-14

试试这个

applicationVariants.all { variant ->
    variant.outputs.each { output ->
        def file = output.outputFile
        output.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
    }
}
 类似资料:
  • 问题内容: 我使用入门程序进行了为期两天的讲座,没有任何问题。我走了几分钟,没有看到任何变化,现在它无法同步。我进行了搜索,但没有发现任何错误。在此先感谢您的帮助。 这是错误: 打开文件 这是我的gradle文件: 问题答案: 您已将compile作为属性使用,但事实并非如此。您需要向其传递一个字符串参数。 编辑 :正如人们在评论中提到的那样,您不应有两个相同的依赖项。但是,这不会引起您描述的问题

  • 问题内容: 我尝试从协会ManyToMany中调出数据,但是我不能,这是我的代码。 实体产品: 实体终端: 类别:模块JPADao 类别:ModuleService main-flow.xml file.xhtml 我无法获得几何的价值;我得到这个错误: 问题答案: javax.el.PropertyNotFoundException:在类型org.hibernate.collection.int

  • 我得到了这个错误,我不知道问题可能在哪里。“userid”列位于数据库和bean中。有人知道吗?

  • 我正在尝试从一个Boostrap模式中的表单发布。 这是我的表格: 致: 给我“bean名称'university'的BindingResult或plain target object都不作为请求属性可用”错误。

  • 我试图运行Webpack上的一个项目和我得到多个错误 我应该安装我所有的打字,所以我不知道这些是从哪里来的。我试图从一个编译的项目中复制package.json,但没有帮助。我错过了什么? 我的tConfig看起来像这样

  • 我试着寻找类似的问题,但没有成功。 谢谢!