问题描述
错误:任务:app:compileDebugKotlin"的执行失败.>编译错误.查看日志了解更多详情
build:gradle(Module:app)
buildscript {存储库{行家{网址https://jitpack.io"网址https://maven.fabric.io/public"}}依赖{类路径 'io.fabric.tools:gradle:1.+'}}应用插件:'com.android.application'应用插件:'kotlin-android'应用插件:'io.fabric'应用插件:'kotlin-android-extensions'存储库{maven { url 'https://maven.fabric.io/public' }MavenCentral()}安卓 {compileSdkVersion 25buildToolsVersion "25.0.2";useLibrary 'org.apache.http.legacy'lintOptions {checkReleaseBuilds falseabortOnError false}默认配置{applicationIduxx.xx.xxe"minSdk 版本 18目标SDK版本25版本代码 17版本名称0.1.14"testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner"}构建类型{发布 {可调试假minifyEnabled true收缩资源真proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}调试{ext.enableCrashlytics = false可调试真minifyEnabled true收缩资源真proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}}源集{主要的 {jniLibs.srcDirs = ['libs']assets.srcDirs = ['src/main/assets', 'src/main/assets/']res.srcDirs = ['src/main/res', 'src/main/assets/fonts']}}dexOptions {巨型模式真javaMaxHeapSize "4g";}包装选项{排除元信息/依赖项"排除元信息/通知"排除元信息/许可证"排除 'META-INF/LICENSE.txt'排除 'META-INF/NOTICE.txt'排除 'META-INF/ECLIPSE_.SF'排除 'META-INF/ECLIPSE_.RSA'}}依赖{编译文件树(包括:['*.jar'],目录:'libs')编译com.android.support:cardview-v7:${rootProject.supportLibraryVersion}"编译com.google.android.gms:play-services-ads:${rootProject.googlePlayServicesVersion}";编译org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version";编译'org.igniterealtime.smack:smack-android-extensions:4.1.9'编译'org.igniterealtime.smack:smack-tcp:4.1.9'编译'org.igniterealtime.smack:smack-experimental:4.1.9'testCompile 'junit:junit:4.12'}应用插件:'com.google.gms.google-services'应用插件:'com.getkeepsafe.dexcount'
build:gradle(项目)
//顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项.
buildscript {ext.kotlin_version = '1.1.2-2'存储库{jcenter()}依赖{类路径 'com.android.tools.build:gradle:2.3.1'类路径 'com.google.gms:google-services:3.0.0'//可视化方法计数类路径 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2'类路径org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"}}所有项目{存储库{jcenter()maven { url "https://jitpack.io";}}}ext.googlePlayServicesVersion = '10.2.0'ext.supportLibraryVersion = '25.3.1'任务清理(类型:删除){删除 rootProject.buildDir}
尝试的解决方案:
- 使缓存无效/重新启动
- 构建 ->清洁项目
- 更新 kotlin 插件,使用最新版本的 kotlin,谷歌 API.
编辑
./gradlew build --stacktrace >日志.txt 2>日志错误.txt
logErrors.txt
* 例外是:org.gradle.api.tasks.TaskExecutionException:任务 ':app:compileDebugKotlin' 执行失败.在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)在 org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)在 org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)在 org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)在 org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)在 org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)在 org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)在 org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)在 org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)在 org.gradle.internal.Transformers$4.transform(Transformers.java:169)在 org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)在 org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)在 org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)在 org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)在 org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)在 org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)在 org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)在 org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)在 org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)在 org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)在 org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)在 org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)在 org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)在 org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)在 org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)在 org.gradle.internal.Transformers$4.transform(Transformers.java:169)在 org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)在 org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)在 org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)在 org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)在 org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)在 org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)在 org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)在 org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)在 org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)在 org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)在 org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)在 org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)在 org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)在 org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)在 org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)在 org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)在 org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)在 org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)在 org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)在 org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)在 org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)在 org.gradle.util.Swapper.swap(Swapper.java:38)在 org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)在 org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)在 org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)在 org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)在 org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)在 org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)在 org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)在 org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)在 org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)在 org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)在 org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)引起:org.gradle.api.GradleException:编译错误.查看日志了解更多详情在 org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.throwGradleExceptionIfError(tasksUtils.kt:8)在 org.jetbrains.kotlin.gradle.tasks.KotlinCompile.processCompilerExitCode(Tasks.kt:286)在 org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:260)在 org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:160)在 org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:141)在 org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)在 org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)在 org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)在 org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)在 org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)... 70 多个
经过简单的代码重构尝试后,我遇到了这样的错误.它发生了,也没有在连接某个库之后,gradle 中也没有任何变化.看起来我的代码中有些东西是错误的,但编译器找不到问题.这就是为什么我仔细检查了我所做的所有更改并发现我以某种方式更改了接口中的方法签名,但没有在实现它的类中更改它.我在一天内两次遇到此错误并决定分享我的经验.我希望这是一个临时的编译器错误.
解决方案 1 可能的解决方案是转到文件 -> 设置 -> 编译器 -> 并将--stacktrace --debug"添加到命令行选项.阅读日志并尝试找到问题的答案.
在新的 Android Studio 3.1.+ 中,您可以通过按构建"选项卡上的切换视图"来启用/禁用控制台日志详细信息.您可以在那里找到详细信息.注意这两种模式都可以用于调查问题的原因.请参阅:
解决方案 2 点击 Gradle
(在右侧栏上)然后在 :app
下选择 assembleDebug
(或 assembleYourFlavor
(如果您使用口味).错误将显示在运行标签中.请参阅:https://stackoverflow.com/a/51022296
解决方案 3 作为最后的手段.在android studio中,尝试Analyze -> Inspect Code -> Whole project.等待检查结束,然后更正常规"部分的错误和其他部分可能的错误.
注意 kapt3 可能是此类错误的来源.我删除了 apply plugin: 'kotlin-kapt'
并将 kapt { generateStubs = true }
添加到 build.gradle 的 android {}
部分.以前版本的 kapt 生成器似乎没有错误.(更新.看起来 kapt 的一个错误在 kotlin 1.2.+ 版本中消失了)
Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details
build:gradle(Module:app)
buildscript {
repositories {
maven {
url 'https://jitpack.io'
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android-extensions'
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
lintOptions {
checkReleaseBuilds false
abortOnError false
}
defaultConfig {
applicationId "uxx.xx.xxe"
minSdkVersion 18
targetSdkVersion 25
versionCode 17
versionName "0.1.14"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
ext.enableCrashlytics = false
debuggable true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
assets.srcDirs = ['src/main/assets', 'src/main/assets/']
res.srcDirs = ['src/main/res', 'src/main/assets/fonts']
}
}
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ECLIPSE_.SF'
exclude 'META-INF/ECLIPSE_.RSA'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:cardview-v7:${rootProject.supportLibraryVersion}"
compile "com.google.android.gms:play-services-ads:${rootProject.googlePlayServicesVersion}"
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'org.igniterealtime.smack:smack-android-extensions:4.1.9'
compile 'org.igniterealtime.smack:smack-tcp:4.1.9'
compile 'org.igniterealtime.smack:smack-experimental:4.1.9'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.getkeepsafe.dexcount'
build:gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.2-2'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.0.0'
//visualize the method count
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
ext.googlePlayServicesVersion = '10.2.0'
ext.supportLibraryVersion = '25.3.1'
task clean(type: Delete) {
delete rootProject.buildDir
}
Solution Tried:
- Invalidate Caches/Restart
- Build -> Clean Project
- Update kotlin plugin, used lastest version of kotlin, google APIs.
EDIT
./gradlew build --stacktrace > logs.txt 2>logErrors.txt
logErrors.txt
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugKotlin'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.GradleException: Compilation error. See log for more details
at org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.throwGradleExceptionIfError(tasksUtils.kt:8)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.processCompilerExitCode(Tasks.kt:286)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:260)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler$kotlin_gradle_plugin(Tasks.kt:160)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:141)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
... 70 more
I got such error after a simple try of code refactoring. It has happened nor after some library was connected neither any changes in gradle. It looked like something in my code was wrong but the compiler could not found the issue. That's why I double checked all changes that I did and found that I had changed somehow method signature in the interface but had not changed it in class that implements it.I got this error twice during one day and decided to share my experience. I hope that it is a temporary compiler bug.
Solution 1 Possible solution is to go to File -> Settings -> Compiler -> and add "--stacktrace --debug" to Command-line Options. Read log and try to found the answer of what went wrong.
In new Android Studio 3.1.+, you can enable/disable console log details by pressing "Toggle View" on "Build" tab. There you can find the details. Pay attention that both modes can be useful for investigation of the problem's reason. See: https://stackoverflow.com/a/49717363/
Solution 2 Click on Gradle
(on the right side bar) then under :app
choose assembleDebug
(or assembleYourFlavor
if you use flavors). Error will show up in Run tab. See: https://stackoverflow.com/a/51022296
Solution 3 As a last resort. In the android studio, try Analyze -> Inspect Code -> Whole project. Wait until the inspection is over and then correct errors in "General" section and possible ones in other sections.
Note The kapt3 can be a source of such bugs. I removed apply plugin: 'kotlin-kapt'
and added kapt { generateStubs = true }
into android {}
section of build.gradle. It seems that the previous version of the kapt generator is bugs free. (Update. It looks like a bug with kapt is gone on kotlin version 1.2.+)
这篇关于错误:任务 ':app:compileDebugKotlin' 的执行失败.>编译错误.查看日志了解更多详情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!