简体   繁体   中英

Could not find property 'packageApplication' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated

After upgrading the android build tools gradle plugin from 0.14.0 to 1.0.0, I can no longer run my debug build on my USB-connected device, using the command 'gradle runDebug'.

However, all other gradle commands work (test, clean build, build).

Here's the stack:

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)

Current Tools

  • 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 Settings

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

我通过将'com.novoda:gradle-android-command-plugin:1.2.1'升级到'com.novoda:gradle-android-command-plugin:1.3.0'来解决这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM