获取错误org.gradle.api.UnknownTaskException:在项目中找不到路径'testDebug'的任务

时间:2014-09-15 06:56:49

标签: android gradle android-studio jacoco

我只是从eclipse迁移到Android Studio。我使用Eclipse插件在Android工作室上转换eclipse项目。到目前为止一切正常。

现在我想将我的单元测试迁移到android studio,我正在尝试使用jacoco找到代码覆盖率,但我收到错误 org.gradle.api.UnknownTaskException: Task with path 'testDebug' not found in project

以下是我的gradle文件:

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':AndroidLibraryDist')
    compile project(':flatfile')
}

android {
    compileSdkVersion 16
    buildToolsVersion '20'

    signingConfigs {
        release {
            storeFile file("../../keystore/example.keystore")
            storePassword "example2013"
            keyAlias "example"
            keyPassword "example2013"
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_5
        targetCompatibility JavaVersion.VERSION_1_5
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
        debug{
            testCoverageEnabled = true
        }
    }


    lintOptions {
        checkReleaseBuilds true
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }


    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('src/test')
        androidTest.setRoot('src/test')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

apply plugin: 'jacoco'

jacoco {
    toolVersion = "0.7.1.201405082137"
}

def coverageSourceDirs = [
        '../myapp/src/example/qoos'
]

task jacocoTestReport(type: JacocoReport, dependsOn: "testDebug") {
    group = "Reporting"

    description = "Generate Jacoco coverage reports"

    classDirectories = fileTree(
            dir: '../qris_application/build/intermediates/classes/debug',
            excludes: ['**/R.class',
                       '**/R$*.class',
                       '**/Manifest*.*']
    )

    additionalSourceDirs = files(coverageSourceDirs)
    sourceDirectories = files(coverageSourceDirs)
    executionData = files('../myapp/build/jacoco/testDebug.exec')

    reports {
        xml.enabled = true
        html.enabled = true
    }
}

以下是./gradlew tasks --debug

的日志
12:09:04.194 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':tasks'.
12:09:04.196 [QUIET] [org.gradle.api.tasks.diagnostics.TaskReportTask_Decorated] 
12:09:04.197 [QUIET] [org.gradle.api.tasks.diagnostics.TaskReportTask_Decorated] ------------------------------------------------------------
12:09:04.198 [QUIET] [org.gradle.api.tasks.diagnostics.TaskReportTask_Decorated] All tasks runnable from root project
12:09:04.199 [QUIET] [org.gradle.api.tasks.diagnostics.TaskReportTask_Decorated] ------------------------------------------------------------
12:09:04.200 [QUIET] [org.gradle.api.tasks.diagnostics.TaskReportTask_Decorated] 
12:09:04.311 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/AndroidLibraryDist/build/intermediates/pre-dexed/test/debug', not found
12:09:04.354 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver] Resolving configuration ':myapp:androidJacocoAgent'
12:09:04.356 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryDependencyMetadataCache] Reusing in-memory cache for repo 'MavenRepo' [e9d03b7c6586155fbee8fb2de8b5b149].
12:09:04.357 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryDependencyMetadataCache] Reusing in-memory cache for repo 'maven' [450f3ea4d3e5f3091b9d1a6643050b0c].
12:09:04.359 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryDependencyMetadataCache] Reusing in-memory cache for repo 'maven2' [1dabf6a944ce7d2e9d4a95e5791f7d19].
12:09:04.360 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder] Visiting configuration qris:myapp:unspecified(androidJacocoAgent).
12:09:04.361 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder] Visiting dependency qris:myapp:unspecified(androidJacocoAgent) -> org.jacoco:org.jacoco.agent:0.6.2.201302030002(dependency: org.jacoco#org.jacoco.agent;0.6.2.201302030002 {androidJacocoAgent=[default]})
12:09:04.362 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder] Selecting new module version org.jacoco:org.jacoco.agent:0.6.2.201302030002
12:09:04.363 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver] Attempting to resolve module 'org.jacoco:org.jacoco.agent:0.6.2.201302030002' using repositories [MavenRepo, maven, maven2]
12:09:04.469 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.IvyXmlModuleDescriptorParser] post 1.3 ivy file: using exact as default matcher
12:09:04.471 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleVersionRepository] Using cached module metadata for module 'org.jacoco#org.jacoco.agent;0.6.2.201302030002' in 'MavenRepo'
12:09:04.472 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver] Using module 'org.jacoco:org.jacoco.agent:0.6.2.201302030002' from repository 'MavenRepo'
12:09:04.473 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder] Visiting configuration org.jacoco:org.jacoco.agent:0.6.2.201302030002(default).
12:09:04.476 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder] Attaching qris:myapp:unspecified(androidJacocoAgent) to its parents.
12:09:04.477 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder] Attaching org.jacoco:org.jacoco.agent:0.6.2.201302030002(default) to its parents.
12:09:04.477 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder] Flushing resolved configuration data in Binary store in /tmp/gradle8492831003563620392.bin. Wrote root qris:myapp:unspecified:androidJacocoAgent.
12:09:04.478 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleVersionRepository] Found artifact 'org.jacoco:org.jacoco.agent:0.6.2.201302030002:org.jacoco.agent.jar' in resolver cache: /home/yuvi/.gradle/caches/modules-2/files-2.1/org.jacoco/org.jacoco.agent/0.6.2.201302030002/4261aa79d35d5a8c06386fa745cf4447b1deb259/org.jacoco.agent-0.6.2.201302030002.jar
12:09:04.484 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/myapp/build/intermediates/pre-dexed/release', not found
12:09:04.508 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/AndroidLibraryDist/build/intermediates/pre-dexed/test/debug', not found
12:09:04.518 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/AndroidLibraryDist/build/intermediates/pre-dexed/test/debug', not found
12:09:04.545 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/AndroidLibraryDist/build/intermediates/pre-dexed/test/debug', not found
12:09:04.679 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/flatfile/build/intermediates/pre-dexed/test/debug', not found
12:09:04.710 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/myapp/build/intermediates/pre-dexed/release', not found
12:09:04.732 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/flatfile/build/intermediates/pre-dexed/test/debug', not found
12:09:04.741 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/flatfile/build/intermediates/pre-dexed/test/debug', not found
12:09:04.763 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/flatfile/build/intermediates/pre-dexed/test/debug', not found
12:09:04.813 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/myapp/build/intermediates/pre-dexed/release', not found
12:09:04.819 [INFO] [org.gradle.api.internal.file.collections.DirectoryFileTree] file or directory '/home/yuvi/workspace/Comm_box/qris/myapp/build/intermediates/pre-dexed/test/debug', not found
12:09:04.841 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':tasks'
12:09:04.842 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :tasks FAILED
12:09:04.843 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :tasks (Thread[main,5,main]) completed. Took 0.664 secs.
12:09:04.844 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 0.664 secs, idle: 0.0040 secs
12:09:04.851 [ERROR] [org.gradle.BuildExceptionReporter] 
12:09:04.852 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
12:09:04.853 [ERROR] [org.gradle.BuildExceptionReporter] 
12:09:04.855 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
12:09:04.855 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':tasks'.
12:09:04.857 [ERROR] [org.gradle.BuildExceptionReporter] > Could not determine the dependencies of task ':myapp:jacocoTestReport'.
12:09:04.880 [ERROR] [org.gradle.BuildExceptionReporter] 
12:09:04.881 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
12:09:04.882 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':tasks'.
12:09:04.883 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
12:09:04.884 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
12:09:04.885 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
12:09:04.885 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
12:09:04.886 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
12:09:04.886 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
12:09:04.887 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
12:09:04.887 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
12:09:04.887 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
12:09:04.888 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
12:09:04.888 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
12:09:04.889 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
12:09:04.889 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
12:09:04.890 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23)
12:09:04.890 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:86)
12:09:04.891 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
12:09:04.892 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
12:09:04.893 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
12:09:04.893 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
12:09:04.894 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
12:09:04.894 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
12:09:04.895 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
12:09:04.895 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
12:09:04.895 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
12:09:04.896 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
12:09:04.896 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
12:09:04.896 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
12:09:04.897 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
12:09:04.897 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
12:09:04.898 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
12:09:04.898 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
12:09:04.910 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
12:09:04.911 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
12:09:04.911 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
12:09:04.912 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
12:09:04.912 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
12:09:04.913 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
12:09:04.913 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
12:09:04.914 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.doAction(Main.java:46)
12:09:04.914 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
12:09:04.914 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.Main.main(Main.java:37)
12:09:04.915 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
12:09:04.915 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
12:09:04.915 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
12:09:04.916 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
12:09:04.916 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
12:09:04.917 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
12:09:04.917 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.GradleException: Could not determine the dependencies of task ':myapp:jacocoTestReport'.
12:09:04.918 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:65)
12:09:04.918 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.AbstractTaskDependency.getDependencies(AbstractTaskDependency.java:27)
12:09:04.918 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.DefaultTaskContainer$1.getNodeValues(DefaultTaskContainer.java:210)
12:09:04.919 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.DefaultTaskContainer$1.getNodeValues(DefaultTaskContainer.java:208)
12:09:04.919 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:200)
12:09:04.920 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:112)
12:09:04.920 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:64)
12:09:04.920 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.DefaultTaskContainer.actualize(DefaultTaskContainer.java:208)
12:09:04.935 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.tasks.diagnostics.TaskReportTask.generate(TaskReportTask.java:72)
12:09:04.936 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.tasks.diagnostics.AbstractReportTask.generate(AbstractReportTask.java:67)
12:09:04.936 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
12:09:04.937 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:219)
12:09:04.937 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:212)
12:09:04.938 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:201)
12:09:04.938 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:533)
12:09:04.938 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:516)
12:09:04.939 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
12:09:04.939 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
12:09:04.940 [ERROR] [org.gradle.BuildExceptionReporter]    ... 46 more
12:09:04.940 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.gradle.api.UnknownTaskException: Task with path 'testDebug' not found in project ':myapp'.
12:09:04.941 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.DefaultTaskContainer.getByPath(DefaultTaskContainer.java:182)
12:09:04.941 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.DefaultTaskContainer.resolveTask(DefaultTaskContainer.java:176)
12:09:04.942 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.DefaultTaskDependency.resolve(DefaultTaskDependency.java:84)
12:09:04.942 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:86)
12:09:04.942 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:200)
12:09:04.943 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:112)
12:09:04.943 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:64)
12:09:04.944 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.doResolve(CachingTaskDependencyResolveContext.java:74)
12:09:04.944 [ERROR] [org.gradle.BuildExceptionReporter]    at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:63)
12:09:04.945 [ERROR] [org.gradle.BuildExceptionReporter]    ... 63 more
12:09:04.945 [ERROR] [org.gradle.BuildExceptionReporter] 
12:09:04.945 [LIFECYCLE] [org.gradle.BuildResultLogger] 
12:09:04.946 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
12:09:04.946 [LIFECYCLE] [org.gradle.BuildResultLogger] 
12:09:04.947 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 7.518 secs

1 个答案:

答案 0 :(得分:0)

在以recommended here

运行命令之前尝试运行./gradlew clean assemble