locked
gradle build Task 'XXX' not found in root project 's' RRS feed

  • Question

  • Hi,

    I created a grade project (Visual C++=>Cross Platform=>Android=>Basic Application (Android,Gradle) and upload to TFS. Then I build it through grade build (VSTS grade build template) with host agent and my custom agent, I specified gradlew.bat file in Gradle wrapper and specify build, or assembleRelease, assemblex86Release or other, then queue build, it always throw exception, build task 'xxx' not found in root project 's'.

    Log:

    2016-08-18T09:43:34.8308965Z ##[section]Starting: gradlew assembleRelease
    2016-08-18T09:43:37.7056488Z Preparing task execution handler.
    2016-08-18T09:43:38.5480121Z Executing the powershell script: D:\1.1_Agents\vso\vsts-agent\_work\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\1.0.49\gradle.ps1
    2016-08-18T09:43:39.1207795Z ##[warning]SonarQube analysis is not yet supported on Windows and hosted agents.
    2016-08-18T09:43:39.1207795Z ##[warning]Please use a dedicated Unix agent to enable this feature: https://github.com/Microsoft/vsts-agent
    2016-08-18T09:43:39.1207795Z ##[warning]PMD code analysis is not yet supported on Windows and hosted agents.
    2016-08-18T09:43:39.1212792Z ##[warning]Please use a dedicated Unix agent to enable this feature: https://github.com/Microsoft/vsts-agent
    2016-08-18T09:43:40.4585450Z 17:43:40.403 [DEBUG] [org.gradle.internal.nativeintegration.services.NativeServices] Native-platform posix files is not available.  Continuing with fallback.
    2016-08-18T09:43:42.3724885Z 17:43:42.264 [INFO] [org.gradle.BuildLogger] Starting Build
    2016-08-18T09:43:42.3724885Z 17:43:42.267 [DEBUG] [org.gradle.BuildLogger] Gradle user home: C:\Windows\ServiceProfiles\NetworkService\.gradle
    2016-08-18T09:43:42.3724885Z 17:43:42.267 [DEBUG] [org.gradle.BuildLogger] Current dir: D:\1.1_Agents\vso\vsts-agent\_work\1\s
    2016-08-18T09:43:42.3724885Z 17:43:42.268 [DEBUG] [org.gradle.BuildLogger] Settings file: null
    2016-08-18T09:43:42.3724885Z 17:43:42.268 [DEBUG] [org.gradle.BuildLogger] Build file: null
    2016-08-18T09:43:42.3724885Z 17:43:42.287 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Starting to build the build sources.
    2016-08-18T09:43:42.3724885Z 17:43:42.289 [DEBUG] [org.gradle.initialization.buildsrc.BuildSourceBuilder] Gradle source dir does not exist. We leave.
    2016-08-18T09:43:42.4730055Z 17:43:42.305 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found env project properties: []
    2016-08-18T09:43:42.4730055Z 17:43:42.305 [DEBUG] [org.gradle.initialization.DefaultGradlePropertiesLoader] Found system project properties: []
    2016-08-18T09:43:42.5810426Z 17:43:42.417 [DEBUG] [org.gradle.initialization.ScriptEvaluatingSettingsProcessor] Timing: Processing settings took: 0.112 secs
    2016-08-18T09:43:42.5810503Z 17:43:42.422 [INFO] [org.gradle.BuildLogger] Settings evaluated using settings file 'D:\master\settings.gradle'.
    2016-08-18T09:43:42.7820906Z 17:43:42.676 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' from state Known to Created
    2016-08-18T09:43:42.7820906Z 17:43:42.684 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks' rule action Project.<init>.tasks()
    2016-08-18T09:43:42.7820906Z 17:43:42.685 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks using Project.<init>.tasks()
    2016-08-18T09:43:42.7820906Z 17:43:42.688 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' to state ProjectionsDefined.
    2016-08-18T09:43:42.7820906Z 17:43:42.689 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks' rule action Project.<init>.tasks()
    2016-08-18T09:43:42.7820906Z 17:43:42.689 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks using Project.<init>.tasks()
    2016-08-18T09:43:42.7820906Z 17:43:42.709 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' to state Created.
    2016-08-18T09:43:42.8823768Z 17:43:42.737 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'nodeInitializerRegistry' from state Known to ProjectionsDefined
    2016-08-18T09:43:42.8839118Z 17:43:42.738 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'nodeInitializerRegistry' rule action Project.<init>.nodeInitializerRegistry()
    2016-08-18T09:43:42.8849221Z 17:43:42.738 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating nodeInitializerRegistry using Project.<init>.nodeInitializerRegistry()
    2016-08-18T09:43:42.8859031Z 17:43:42.739 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'nodeInitializerRegistry' to state ProjectionsDefined.
    2016-08-18T09:43:42.8859031Z 17:43:42.741 [DEBUG] [org.gradle.initialization.ProjectPropertySettingBuildLoader] Looking for project properties from: D:\1.1_Agents\vso\vsts-agent\_work\1\s\gradle.properties
    2016-08-18T09:43:42.8859031Z 17:43:42.742 [DEBUG] [org.gradle.initialization.ProjectPropertySettingBuildLoader] project property file does not exists. We continue!
    2016-08-18T09:43:42.8859031Z 17:43:42.743 [INFO] [org.gradle.BuildLogger] Projects loaded. Root project using build file 'D:\1.1_Agents\vso\vsts-agent\_work\1\s\build.gradle'.
    2016-08-18T09:43:42.8859031Z 17:43:42.744 [INFO] [org.gradle.BuildLogger] Included projects: [root project 's']
    2016-08-18T09:43:43.0916677Z 17:43:42.995 [INFO] [org.gradle.configuration.project.BuildScriptProcessor] Evaluating root project 's' using build file 'D:\1.1_Agents\vso\vsts-agent\_work\1\s\build.gradle'.
    2016-08-18T09:43:43.0916677Z 17:43:43.000 [DEBUG] [org.gradle.configuration.project.BuildScriptProcessor] Timing: Running the build script took 0.005 secs
    2016-08-18T09:43:43.0916677Z 17:43:43.002 [INFO] [org.gradle.BuildLogger] All projects evaluated.
    2016-08-18T09:43:43.0916677Z 17:43:43.046 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' from state Created to SelfClosed
    2016-08-18T09:43:43.0916677Z 17:43:43.046 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' to state RulesDefined.
    2016-08-18T09:43:43.0916677Z 17:43:43.047 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' to state DefaultsApplied.
    2016-08-18T09:43:43.0916677Z 17:43:43.047 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' to state Initialized.
    2016-08-18T09:43:43.0916677Z 17:43:43.048 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' to state Mutated.
    2016-08-18T09:43:43.0916677Z 17:43:43.048 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' to state Finalized.
    2016-08-18T09:43:43.0916677Z 17:43:43.049 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' to state SelfClosed.
    2016-08-18T09:43:43.0916677Z 17:43:43.050 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks' from state SelfClosed to SelfClosed
    2016-08-18T09:43:43.0916677Z 17:43:43.050 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.components' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.0916677Z 17:43:43.051 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.components' rule action tasks.addPlaceholderAction(components)
    2016-08-18T09:43:43.0916677Z 17:43:43.051 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.components using tasks.addPlaceholderAction(components)
    2016-08-18T09:43:43.0916677Z 17:43:43.051 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.components' to state ProjectionsDefined.
    2016-08-18T09:43:43.0926672Z 17:43:43.054 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.dependencies' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1926927Z 17:43:43.054 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.dependencies' rule action tasks.addPlaceholderAction(dependencies)
    2016-08-18T09:43:43.1926927Z 17:43:43.055 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.dependencies using tasks.addPlaceholderAction(dependencies)
    2016-08-18T09:43:43.1926927Z 17:43:43.056 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.dependencies' to state ProjectionsDefined.
    2016-08-18T09:43:43.1926927Z 17:43:43.057 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.dependencyInsight' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1926927Z 17:43:43.061 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.dependencyInsight' rule action tasks.addPlaceholderAction(dependencyInsight)
    2016-08-18T09:43:43.1926927Z 17:43:43.062 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.dependencyInsight using tasks.addPlaceholderAction(dependencyInsight)
    2016-08-18T09:43:43.1926927Z 17:43:43.063 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.dependencyInsight' to state ProjectionsDefined.
    2016-08-18T09:43:43.1926927Z 17:43:43.064 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.help' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1926927Z 17:43:43.065 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.help' rule action tasks.addPlaceholderAction(help)
    2016-08-18T09:43:43.1926927Z 17:43:43.065 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.help using tasks.addPlaceholderAction(help)
    2016-08-18T09:43:43.1926927Z 17:43:43.066 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.help' to state ProjectionsDefined.
    2016-08-18T09:43:43.1926927Z 17:43:43.067 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.init' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1926927Z 17:43:43.068 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.init' rule action tasks.addPlaceholderAction(init)
    2016-08-18T09:43:43.1926927Z 17:43:43.068 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.init using tasks.addPlaceholderAction(init)
    2016-08-18T09:43:43.1926927Z 17:43:43.069 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.init' to state ProjectionsDefined.
    2016-08-18T09:43:43.1926927Z 17:43:43.070 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.model' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1936883Z 17:43:43.071 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.model' rule action tasks.addPlaceholderAction(model)
    2016-08-18T09:43:43.1936883Z 17:43:43.072 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.model using tasks.addPlaceholderAction(model)
    2016-08-18T09:43:43.1936883Z 17:43:43.072 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.model' to state ProjectionsDefined.
    2016-08-18T09:43:43.1936883Z 17:43:43.072 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.projects' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1936883Z 17:43:43.074 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.projects' rule action tasks.addPlaceholderAction(projects)
    2016-08-18T09:43:43.1936883Z 17:43:43.074 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.projects using tasks.addPlaceholderAction(projects)
    2016-08-18T09:43:43.1936883Z 17:43:43.075 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.projects' to state ProjectionsDefined.
    2016-08-18T09:43:43.1936883Z 17:43:43.076 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.properties' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1936883Z 17:43:43.076 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.properties' rule action tasks.addPlaceholderAction(properties)
    2016-08-18T09:43:43.1936883Z 17:43:43.077 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.properties using tasks.addPlaceholderAction(properties)
    2016-08-18T09:43:43.1936883Z 17:43:43.077 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.properties' to state ProjectionsDefined.
    2016-08-18T09:43:43.1936883Z 17:43:43.078 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.tasks' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1936883Z 17:43:43.079 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.tasks' rule action tasks.addPlaceholderAction(tasks)
    2016-08-18T09:43:43.1936883Z 17:43:43.079 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.tasks using tasks.addPlaceholderAction(tasks)
    2016-08-18T09:43:43.1936883Z 17:43:43.080 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.tasks' to state ProjectionsDefined.
    2016-08-18T09:43:43.1936883Z 17:43:43.080 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.wrapper' from state Known to ProjectionsDefined
    2016-08-18T09:43:43.1936883Z 17:43:43.081 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.wrapper' rule action tasks.addPlaceholderAction(wrapper)
    2016-08-18T09:43:43.1936883Z 17:43:43.081 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.wrapper using tasks.addPlaceholderAction(wrapper)
    2016-08-18T09:43:43.1936883Z 17:43:43.081 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.wrapper' to state ProjectionsDefined.
    2016-08-18T09:43:43.1936883Z ##[error]17:43:43.092 [ERROR] [org.gradle.BuildExceptionReporter]
    2016-08-18T09:43:43.1936883Z ##[error]17:43:43.092 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
    2016-08-18T09:43:43.1936883Z ##[error]17:43:43.093 [ERROR] [org.gradle.BuildExceptionReporter]
    2016-08-18T09:43:43.1936883Z ##[error]17:43:43.093 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
    2016-08-18T09:43:43.1936883Z ##[error]17:43:43.094 [ERROR] [org.gradle.BuildExceptionReporter] Task 'assembleRelease' not found in root project 's'.
    2016-08-18T09:43:43.1936883Z ##[error]17:43:43.094 [ERROR] [org.gradle.BuildExceptionReporter]
    2016-08-18T09:43:43.1936883Z ##[error]17:43:43.094 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
    2016-08-18T09:43:43.1936883Z ##[error]17:43:43.095 [ERROR] [org.gradle.BuildExceptionReporter] Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace.
    2016-08-18T09:43:43.1936883Z 17:43:43.096 [LIFECYCLE] [org.gradle.BuildResultLogger]
    2016-08-18T09:43:43.1936883Z 17:43:43.097 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
    2016-08-18T09:43:43.1936883Z 17:43:43.097 [LIFECYCLE] [org.gradle.BuildResultLogger]
    2016-08-18T09:43:43.1936883Z 17:43:43.097 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 3.452 secs
    2016-08-18T09:43:43.1950336Z 17:43:43.099 [DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Cache Plugin Resolution Cache (C:\Windows\ServiceProfiles\NetworkService\.gradle\caches\2.8\plugin-resolution) was closed 0 times.
    2016-08-18T09:43:43.2072067Z ##[error]System.Exception: Unexpected exit code received from batch file: 1
    2016-08-18T09:43:43.2072067Z    at Microsoft.TeamFoundation.DistributedTask.Task.Internal.InvokeBatchScriptCmdlet.ProcessRecord()
    2016-08-18T09:43:43.2072067Z    at System.Management.Automation.CommandProcessor.ProcessRecord()
    2016-08-18T09:43:43.4637608Z 
    2016-08-18T09:43:43.4637608Z 
    2016-08-18T09:43:43.4647596Z No JUnit test results files were found matching pattern 'D:\1.1_Agents\vso\vsts-agent\_work\1\s\**/build/test-results/TEST-*.xml', so publishing JUnit test results is being skipped.
    2016-08-18T09:43:43.4647596Z 
    2016-08-18T09:43:43.4647596Z 
    2016-08-18T09:43:43.4947658Z ##[error]PowerShell script completed with 1 errors.

    However I go to the agent source folder (e.g. xxx\1\s) and run gradle/gradlew tasks, these tasks are available.

    What's the reason?    

    Thursday, August 18, 2016 10:04 AM

All replies