Task 'Run' not found in root project 'riseon-parents-android'.

忽然报错,导致项目运行不了,这个错误并不是真实的错误!!
清缓存重启如果不管用,就新切一个分支!真实的原因就会出来了

发现一个方法可以查看报错详情,特此记录:

Task 'Run' not found in root project 'riseon-parents-android'._第1张图片
在红框中输入 Run with --stacktrace

Run with --stacktrace

我们经常能看到这样的提示:


提示

关于此 bug

Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details

按照上述配置,然后再次运行项目就可以看到详细报错了:

Executing tasks: [:app:assembleDemoDebug]

app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.2'.
WARNING: Configuration 'testApi' is obsolete and has been replaced with 'testImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'androidTestApi' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
library: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'android.arch.persistence.room:compiler:1.0.0-beta2'.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'Run' not found in root project 'riseon-parents-android'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.execution.TaskSelectionException: Task 'Run' not found in root project 'riseon-parents-android'.
    at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:116)
    at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:81)
    ...

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

可以看到发生错误的地方:

app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.android.databinding:compiler:3.1.2'.

library: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'android.arch.persistence.room:compiler:1.0.0-beta2'.

如果清缓存重启都不管用,就新切一个分支出来,clean & run
真正的报错就出来了,然后解决就可以了

error: Validation of GraphQL query document failed
:app:installApolloCodegen
.../main/graphql/auth/Rise.graphql: Cannot query field "accid" on type "User".
error: Validation of GraphQL query document failed
:app:generateDemoDebugApolloIR FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDemoDebugApolloIR'.
> Process 'command '/Users/jake/Documents/code/riseon_android/riseon-parents-android/app/.gradle/nodejs/node-v6.7.0-darwin-x64/bin/node'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 18s
19 actionable tasks: 18 executed, 1 up-to-date

你可能感兴趣的:(Task 'Run' not found in root project 'riseon-parents-android'.)