android - 在 com.android.build.gradle.internal.api.ApplicationVariantImpl 上找不到属性 'processManifest'

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

我目前正在尝试将 Android Studio 更新到 1.0.0-RC。这似乎需要 gradle Android 插件 1.0.0-rc1。更新后,我开始出现以下错误:

`Could not find property 'processManifest' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@b9da89c.`

经过一番挖掘,似乎 processManifest0.14.3 version 中删除的已弃用属性之一.知道新的属性名称是什么吗?新版本没有更新相同的用户指南,所以我找不到任何文档。

编辑:这是需要该属性的代码。我使用它将一些构建时值注入(inject) list :

applicationVariants.all { variant ->
        variant.processManifest << {
            def manifestOutFile = variant.processManifest.manifestOutputFile
            def newFileContents = manifestOutFile.getText('UTF-8')
                    .replace("{GOOGLE_MAPS_KEY}", variant.buildType.ext.google_maps_key)
            manifestOutFile.write(newFileContents, 'UTF-8')
        }
    }

最佳答案

在 Beta channel 更新到 Android Studio 1.0.0 后,我也遇到了这个错误。但是,我在自己的 gradle 文件中找不到对 processManifest 的任何引用。经过一番搜索,我意识到我需要一个新的 Robolectric gradle 插件:

https://github.com/robolectric/robolectric-gradle-plugin/releases

使用 Robolectric Gradle 插件的 0.14.0 版(和 Robolectric 的 2.4 版)已为我解决了该错误。

关于android - 在 com.android.build.gradle.internal.api.ApplicationVariantImpl 上找不到属性 'processManifest',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27302965/

相关文章:

Android Studio 2.0 预览版 : ':app:transformClassesWithInstantRunForDebug' FAILED

android - 有没有办法防止在 SDK 登录中缓存用户名?

android - android 中 paytm 支付网关集成中的客户端证书是什么?

android - 使用 alljoyn 发送数据

java - Gradle 从依赖子项目中排除组

java - 从光标覆盖或更新 Android 播放列表数据库

java - !array[0].isEmpty() 返回 NullPointer?

android - Gradle 脚本自动版本并在 Android 中包含提交哈希

maven - Gradle 是否支持 GCP 数据流模板?

android - AAR ProGuard 不混淆