Android Studio 2.2.3 + Kotlin 1.1.3-2 , Gradle not finished with unknown issue


#1

Actually this situation repeats on both computers, without any changing of build.gradle

Try to clean/rebuild , delete build folder and reinstall Android Studio

Android Studio tells me:
> Error:Execution failed for task ‘:app:kaptDebugKotlin’.
> Internal compiler error. See log for more details

And the log file is something like this:
2017-07-20 22:30:00,020 [ 182387] INFO - roid.sdk.MessageBuildingSdkLog - Exception from KotlinOutputParser
2017-07-20 22:30:00,030 [ 182397] INFO - roid.sdk.MessageBuildingSdkLog - com.android.ide.common.blame.Message.(com.android.ide.common.blame.Message$Kind, java.lang.String, java.lang.String, com.google.common.collect.ImmutableList)
java.lang.NoSuchMethodException: com.android.ide.common.blame.Message.(com.android.ide.common.blame.Message$Kind, java.lang.String, java.lang.String, com.google.common.collect.ImmutableList)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper$simpleMessageConstructor$2.invoke(KotlinOutputParserHelper.kt:171)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper$simpleMessageConstructor$2.invoke(KotlinOutputParserHelper.kt:143)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.getSimpleMessageConstructor(KotlinOutputParserHelper.kt)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createNewMessage(KotlinOutputParserHelper.kt:272)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createMessage(KotlinOutputParserHelper.kt:250)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createMessage$default(KotlinOutputParserHelper.kt:244)
at org.jetbrains.kotlin.android.KotlinOutputParserHelperKt.parse(KotlinOutputParserHelper.kt:66)
at org.jetbrains.kotlin.android.KotlinOutputParser.parse(KotlinOutputParser.java:28)
at com.android.ide.common.blame.parser.ToolOutputParser.parseToolOutput(ToolOutputParser.java:86)
at com.android.tools.idea.gradle.output.parser.BuildOutputParser.parseGradleOutput(BuildOutputParser.java:43)
at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutor$GradleTasksExecutorImpl.lambda$collectMessages$5(GradleTasksExecutor.java:516)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-07-20 22:30:00,030 [ 182397] INFO - roid.sdk.MessageBuildingSdkLog - Exception from KotlinOutputParser
2017-07-20 22:30:00,042 [ 182409] INFO - roid.sdk.MessageBuildingSdkLog - com.android.ide.common.blame.Message.(com.android.ide.common.blame.Message$Kind, java.lang.String, java.lang.String, com.google.common.collect.ImmutableList)
java.lang.NoSuchMethodException: com.android.ide.common.blame.Message.(com.android.ide.common.blame.Message$Kind, java.lang.String, java.lang.String, com.google.common.collect.ImmutableList)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper$simpleMessageConstructor$2.invoke(KotlinOutputParserHelper.kt:171)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper$simpleMessageConstructor$2.invoke(KotlinOutputParserHelper.kt:143)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.getSimpleMessageConstructor(KotlinOutputParserHelper.kt)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createNewMessage(KotlinOutputParserHelper.kt:272)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createMessage(KotlinOutputParserHelper.kt:250)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createMessage$default(KotlinOutputParserHelper.kt:244)
at org.jetbrains.kotlin.android.KotlinOutputParserHelperKt.parse(KotlinOutputParserHelper.kt:66)
at org.jetbrains.kotlin.android.KotlinOutputParser.parse(KotlinOutputParser.java:28)
at com.android.ide.common.blame.parser.ToolOutputParser.parseToolOutput(ToolOutputParser.java:86)
at com.android.tools.idea.gradle.output.parser.BuildOutputParser.parseGradleOutput(BuildOutputParser.java:43)
at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutor$GradleTasksExecutorImpl.lambda$collectMessages$5(GradleTasksExecutor.java:516)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-07-20 22:30:00,042 [ 182409] INFO - roid.sdk.MessageBuildingSdkLog - Exception from KotlinOutputParser
2017-07-20 22:30:00,052 [ 182419] INFO - roid.sdk.MessageBuildingSdkLog - com.android.ide.common.blame.Message.(com.android.ide.common.blame.Message$Kind, java.lang.String, java.lang.String, com.google.common.collect.ImmutableList)
java.lang.NoSuchMethodException: com.android.ide.common.blame.Message.(com.android.ide.common.blame.Message$Kind, java.lang.String, java.lang.String, com.google.common.collect.ImmutableList)
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getConstructor(Class.java:1825)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper$simpleMessageConstructor$2.invoke(KotlinOutputParserHelper.kt:171)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper$simpleMessageConstructor$2.invoke(KotlinOutputParserHelper.kt:143)
at kotlin.SynchronizedLazyImpl.getValue(Lazy.kt:130)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.getSimpleMessageConstructor(KotlinOutputParserHelper.kt)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createNewMessage(KotlinOutputParserHelper.kt:272)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createMessage(KotlinOutputParserHelper.kt:250)
at org.jetbrains.kotlin.android.KotlinOutputParserHelper.createMessage$default(KotlinOutputParserHelper.kt:244)
at org.jetbrains.kotlin.android.KotlinOutputParserHelperKt.parse(KotlinOutputParserHelper.kt:41)
at org.jetbrains.kotlin.android.KotlinOutputParser.parse(KotlinOutputParser.java:28)
at com.android.ide.common.blame.parser.ToolOutputParser.parseToolOutput(ToolOutputParser.java:86)
at com.android.tools.idea.gradle.output.parser.BuildOutputParser.parseGradleOutput(BuildOutputParser.java:43)
at com.android.tools.idea.gradle.project.build.invoker.GradleTasksExecutor$GradleTasksExecutorImpl.lambda$collectMessages$5(GradleTasksExecutor.java:516)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:307)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2017-07-20 22:30:00,052 [ 182419] INFO - roid.sdk.MessageBuildingSdkLog - Exception from KotlinOutputParser
2017-07-20 22:30:00,085 [ 182452] INFO - pl.ProjectRootManagerComponent - project roots have changed
2017-07-20 22:30:00,111 [ 182478] INFO - a.gradle.run.MakeBeforeRunTask - Gradle invocation complete, success = false
2017-07-20 22:30:00,169 [ 182536] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 1ms; general responsiveness: ok; EDT responsiveness: ok
2017-07-20 22:30:00,193 [ 182560] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 23ms; general responsiveness: ok; EDT responsiveness: ok
2017-07-20 22:30:00,193 [ 182560] INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 1 files to update
2017-07-20 22:30:00,330 [ 182697] INFO - .diagnostic.PerformanceWatcher - Unindexed files update took 137ms; general responsiveness: ok; EDT responsiveness: ok


#2

After a debugging and watching gradle console output , I find the main reason was Dagger2.
So kapt was complaining about @inject annotations, I commented all these places in code , reran and all was alright.
After that I uncommented these places and everything was be ok.


#3

I also meet this problem , have you resovled it?

I modify the kotlin version from 1.1.3-2 to 1.1.4 in gradle today and meet this problem. whatever can’t resolve it.
Restore the kotlin version to 1.1.3-2 , the problem will not happen again.


#4

I find the rootcause for this problem.

I just modified the version to 1.1.4 in app’s build.gradle. And the version in project’s build.gralde still was 1.3.2.

So the problem happened.
Today i modify version in build.gradle both app’s and project. It doesn’t prompt this exception.


#5

is gradle version problem.you can change the version ,hope that will resovle your problem,


#6

I got the same problem My android studio version is 3.0,and kotlin version is 1.1.51