Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing to missing property 'destinationDir' using the latest gradle plugin(0.13.0) #66

Closed
KeithYokoma opened this issue Sep 19, 2014 · 9 comments

Comments

@KeithYokoma
Copy link

I'm using a robolectric and I configured my project with the latest gradle plugin(0.13.0).
I got a message below and build failed.
No problem is happened with the previous version of gradle plugin(0.12.2 and earlier), so probably something has changed on the new plugin.

Environment:
JDK: 1.8.0_05
Gradle plugin: 0.13.0
Gradle version: 2.1

$ ./gradlew assembleDebug --stacktrace

Caused by: groovy.lang.MissingPropertyException: No such property: destinationDir for class: org.gradle.api.DefaultTask_Decorated
    at org.gradle.api.internal.plugins.ExtraPropertiesDynamicObjectAdapter.setProperty(ExtraPropertiesDynamicObjectAdapter.java:46)
    at org.gradle.api.internal.CompositeDynamicObject.setProperty(CompositeDynamicObject.java:119)
    at org.gradle.api.DefaultTask_Decorated.setProperty(Unknown Source)
    at org.robolectric.gradle.RobolectricPlugin$_apply_closure1.doCall(RobolectricPlugin.groovy:128)
    at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
    at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
    at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:164)
    at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:159)
    at com.android.build.gradle.AppExtension.addVariant(AppExtension.groovy:48)
    at com.android.build.gradle.internal.VariantManager.createVariantApiObjects(VariantManager.java:645)
    at com.android.build.gradle.internal.VariantManager.createApiObjects(VariantManager.java:614)
    at com.android.build.gradle.internal.VariantManager.createAndroidTasks(VariantManager.java:225)
    at com.android.build.gradle.internal.VariantManager$createAndroidTasks.call(Unknown Source)
    at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.groovy:444)
    at com.android.build.gradle.BasePlugin$_apply_closure7.doCall(BasePlugin.groovy:355)
    at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40)
    at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
    at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
    ... 52 more

This error is occurred on the build configuration stage so that every task will fail with this problem.

Our dependencies are below.

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'org.robolectric:robolectric-gradle-plugin:0.11.0'
  }
}

allprojects {
    repositories {
        mavenCentral()
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
    }
}

apply plugin: 'robolectric'

dependencies {
  androidTestCompile('org.robolectric:robolectric:2.3') {
        exclude module: 'classworlds'
        exclude module: 'commons-logging'
        exclude module: 'httpclient'
        exclude module: 'maven-artifact'
        exclude module: 'maven-artifact-manager'
        exclude module: 'maven-error-diagnostics'
        exclude module: 'maven-model'
        exclude module: 'maven-plugin-registry'
        exclude module: 'maven-profile'
        exclude module: 'maven-project'
        exclude module: 'maven-settings'
        exclude module: 'nekohtml'
        exclude module: 'plexus-container-default'
        exclude module: 'plexus-interpolation'
        exclude module: 'plexus-utils'
        exclude module: 'wagon-file'
        exclude module: 'wagon-http-lightweight'
        exclude module: 'wagon-http-shared'
        exclude module: 'wagon-provider-api'
    }
}
@emilesvt
Copy link

It also appears there was some work done to remove those deprecated properties (that was merged into master) but a new release hasn't been made yet.

@erd
Copy link
Member

erd commented Sep 19, 2014

I'll do some testing with the new Android gradle plugin this weekend. If everything looks good, I'll make a new release.

@emilesvt
Copy link

👍 AWESOME!

@KeithYokoma
Copy link
Author

Nice! +1

@emilesvt
Copy link

Any update to this issue? Looking forward to using Robolectric with latest version of AS+gradle plugin...

@HoloRin
Copy link

HoloRin commented Sep 22, 2014

I'm working on a project that would also be interested in testing out this combination due to some Intellij issues we are experiencing.

@ChristianKatzmann
Copy link
Contributor

This issue was already fixed in commit 5aa0aff and released with the 0.12.0 release of this plugin. Just update your buildscript classpath to use classpath 'org.robolectric:robolectric-gradle-plugin:0.12.0' and this failure should disappear.

@KeithYokoma
Copy link
Author

It works with classpath 'org.robolectric:robolectric-gradle-plugin:0.12.0'! Thank you so much 👍 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants