无法在com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated上找到属性'packageApplication'

时间:2015-01-14 15:36:24

标签: android gradle android-gradle build.gradle

将android build tools gradle插件从0.14.0升级到1.0.0后,我无法再使用命令' gradle runDebug'在我的USB连接设备上运行我的调试版本。

但是,所有其他gradle命令都有效(测试,清理构建,构建)。

这是堆栈:

Execution failed for task ':myAndroidApp:installDeviceDebug'.
> Could not find property 'packageApplication' on
com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@4001495a.

org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':myAndroidApp:installDeviceDebug'.

Caused by: groovy.lang.MissingPropertyException: Could not find property 'packageApplication' on
com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@4001495a.
at
org.gradle.api.internal.AbstractDynamicObject.propertyMissingException(AbstractDynamicObject.java:43)
at org.gradle.api.internal.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:35)
at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:94)
at com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated.getProperty(Unknown Source)
at com.novoda.gradle.command.VariantConfigurator$_configure_closure2.doCall(VariantConfigurator.groovy:29)
at com.novoda.gradle.command.AdbCommand.toString(AdbCommand.groovy:19)
at com.novoda.gradle.command.AdbTask.runCommand(AdbTask.groovy:35)
at com.novoda.gradle.command.Install.exec(Install.groovy:9)

当前工具

  • OSX Yosemite 10.10.1
  • IntelliJ 14 EAP(139.1038.6)
  • Gradle 2.2.1
  • Android SDK 24.0.2
  • Robolectric 2.4
  • robolectric-gradle-plugin 0.14.1

Gradle Build设置

  • compileSdkVersion 19
  • buildToolsVersion 19.1.0
  • minSdkVersion 16
  • targetSdkVersion 19

1 个答案:

答案 0 :(得分:3)

我通过将'com.novoda:gradle-android-command-plugin:1.2.1'升级到'com.novoda:gradle-android-command-plugin:1.3.0'来修复此问题。