首页 > 其他分享> > 在com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated上找不到属性“ packageApplication”
在com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated上找不到属性“ packageApplication”
作者:互联网
将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优胜美地10.10.1
> IntelliJ 14 EAP(139.1038.6)
>摇篮2.2.1
> Android SDK 24.0.2
> Robolectric 2.4
> robolectric-gradle-plugin 0.14.1
Gradle构建设置
> 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’来解决此问题.
标签:build-gradle,gradle,android,android-gradle-plugin 来源: https://codeday.me/bug/20191120/2047123.html