Hi guys & girls :wave: I am currently trying ...
# dokka
l
Hi guys & girls ๐Ÿ‘‹ I am currently trying out dokka
1.4.0-RC
at my company. We had dokka
0.10.0
before and it worked, but with
1.4.0-RC
I get the following error in the
Creating documentation models
phase:
Couldn't get delegate for class
Does anyone have an idea what that could be or how to get any information what class causes this problem?
s
What Kotlin version are you using? ๐Ÿ™„
l
I tried it with 1.4.0 rc as well as 1.3.72. Both show the same error. Any other data that would help?
s
Is your project open source? Can you provide the full stacktrace?
l
Unfortunately not open source, I will send a stacktrace tomorrow morning.
This is the stack trace, thanks for having a look:
Copy code
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':dokkaHtml'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:205)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:203)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments: Couldn't get delegate for class
	at org.jetbrains.kotlin.asJava.builder.LightClassDataHolderKt.findDelegate(LightClassDataHolder.kt:103)
	at org.jetbrains.kotlin.asJava.builder.LightClassDataHolder$ForClass$findDataForClassOrObject$1.invoke(LightClassDataHolder.kt:40)
	at org.jetbrains.kotlin.asJava.builder.LightClassDataHolder$ForClass$findDataForClassOrObject$1.invoke(LightClassDataHolder.kt:34)
	at org.jetbrains.kotlin.asJava.builder.LightClassDataHolderImpl.findData(LightClassDataHolder.kt:86)
	at org.jetbrains.kotlin.asJava.builder.LightClassDataHolderImpl.findData(LightClassDataHolder.kt:82)
	at org.jetbrains.kotlin.asJava.builder.LightClassDataHolder$ForClass$DefaultImpls.findDataForClassOrObject(LightClassDataHolder.kt:40)
s
Are you using java and kotlin inside your project? This might be an issue inside the kotlin compiler (you can see that it is not failing inside a dokka method). The best option is to repeat this with an updated version of the compiler. If it still fails, we might want to create a proper bug ticket for it. You can dm me about this any time ๐Ÿ‘
l
Yes, there is unfortunately still quite some java left. ๐Ÿ˜… The compiler is set in Preferences -> Kotlin Compiler, correct? Is there any more recent version I could configure? ๐Ÿค”
s
What Kotlin Gradle Plugin version are you using? -> Not the compiler version cannot be set by using any idea setting. Dokka bundles a version of the compiler itself!
l
What Kotlin Gradle Plugin version are you using?
1.4.0-rc
Not the compiler version cannot be set by using any idea setting. Dokka bundles a version of the compiler itself!
So there is no way for me to change it?
s
I mean, there would be a way, but no suitable&newer version of this artifact is release somewhere yet. You can track this https://github.com/Kotlin/dokka/issues/1313 to see our update to 1.4.0
l
Ok, cool! Thanks for the link, looking forward to this and will try as soon as possible. Thanks for your help! ๐Ÿ™‚
I retested with 1.4.0-dev-35, unfortunately the result is the same. ๐Ÿ˜” I will try to get a public sample that produces the same result.
s
Oh, you were waiting for this to be fixed. ๐Ÿ˜ž I already thought that this compiler update has low changes of fixing such an issue. If you can provide me a public sample, then I will be able to take care of your issue โ˜บ๏ธ
l
Ok it took me some time but I managed to reproduce the issue ๐ŸŽ‰. (Or at least one scenario where this occurs.) It is quite simple to reproduce: Create an empty Android application and ad two files. First one is a java file:
Copy code
package com.example.dokkasample;


public class SampleService implements Sample.NestedClass {}
And the second one is a Kotlin file:
Copy code
class Sample {
    interface NestedClass
}
When running
gradle app:dokkaHtml
this now produces the error mentioned above. Tested in 1.4.0 alpha.
This should do the trick.
@Sebastian Sellmair [JB] should I create an issue in the dokka repo? ๐Ÿค”
I jumped the line and created the issue.