问题描述
我遵循中的gradle插件部分。
我也尝试了。
我使用的版本是:
android:'23 .1.1'
dokka:'0.9.6'
gradle-android-plugin:'1.5.0'
kotlin:'1.0.0-rc-1036'
但我也尝试过使用从0.9到0.9.7的Dokka版本。
相关输出的部分是:
...
:app:dokka失败
:app:dokka(Thread [Daemon worker Thread 9,5,main])完成。花了0.766秒。
失败:构建失败,出现异常。
*出错:
任务':app:dokka'的执行失败。
> com.intellij.mock.MockComponentManager.getPicoContainer()Lorg / PicoContainer的/ MutablePicoContainer;
*尝试:
使用--debug选项运行以获取更多日志输出。
*例外是:
org.gradle.api.tasks.TaskExecutionException:执行任务':app:dokka'失败。在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions
(ExecuteActionsTaskExecuter.java:69)在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter
。的java:46)
。在在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
。执行(SkipUpToDateTaskExecuter.java:64)
在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
在org.gradle.api.internal.tasks。执行.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api。 internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:5 3)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java: 63)在org.gradle.execution.taskgraph.AbstractTaskPlanExecutor $ TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
。在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23
)中在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88)
在org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
。在组织.gradle.execution.DefaultBuildEx ecuter.execute(DefaultBuildExecuter.java:62)
在org.gradle.execution.DefaultBuildExecuter.access $ 200(DefaultBuildExecuter.java:23)
在org.gradle.execution.DefaultBuildExecuter $ 2.proceed(DefaultBuildExecuter。
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62)
在org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55)
在org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149)
在org.gradle.initialization.DefaultGradleLauncher .doBuild(DefaultGradleLauncher.java:106)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
at org.gradle.launcher.exec.InProcessBuildActionExecuter $ DefaultBuildController.run(InProcessBuildActionExecuter .java:80)$ or
at org.gradle.launcher.cli.ExecuteBui ldAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute( InProcessBuildActionExecuter.java:36)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild( ExecuteBuild.java:47)
在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec。 DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35)
at org.gradle.launcher.daemon。 server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
在org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java: 24)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute( StartStopIfBuildAndStop.java:33)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec。 ForwardClientInput $ 2.call(ForwardClientInput.java:71)
在org.gradle.launcher.daemon.server.exec.ForwardClientInput $ 2.call(ForwardClientInput.java:69)
在org.gradle.util。 Swapper.swap(Swapper.java:38)
位于org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69)
位于org.gradle.launcher.daemon。 server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
在org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
在org.gradle。 launcher.daemon.server.exec.BuildCommandOnly.e xecute(BuildCommandOnly.java:34)
在org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
位于org.gradle.launcher.daemon.server。 exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:70)
在org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
在org.gradle.launcher。 daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39)
at org。 gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy $ 1.run(StartBuildOrRespondWithBusy.java:46)
在org.gradle.launcher.daemon.server.DaemonStateCoordinator $ 1.run(DaemonStateCoordinator.java:246)
在org.gradle.internal.concurrent.DefaultExecutorFact ory $ StoppableExecutorImpl $ 1.run(DefaultExecutorFactory.java:64)
引起:java.lang.NoSuchMethodError:com.intellij.mock.MockComponentManager.getPicoContainer()Lorg / picocontainer / MutablePicoContainer;
at org.jetbrains.dokka.AnalysisEnvironment.createCoreEnvironment(AnalysisEnvironment.kt:78)
at org.jetbrains.dokka.Utilities.DokkaModule.configure(DokkaModule.kt:50)
at com .google.inject.spi.Elements $ RecordingBinder.install(Elements.java:340)
,位于com.google.inject.spi.Elements.getElements(Elements.java:110)
,位于com.google .inject.internal.InjectorShell $ Builder.build(InjectorShell.java:138)
com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
com.google.inject .Guice.createInjector(Guice.java:96)
在com.google.inject.Guice.createInjector(Guice.java:73)
在com.google.inject.Guice.createInjector(Guice.java :62)
at org.jetbrains.dokka.DokkaGenerator.generate(main.kt:160)
at org.jetbrains.dokka.gradle.DokkaTask.generate(main.kt:63)
org.gradle.api.internal.project.tas中的org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
kfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
在org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
。在组织。 gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory $ StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute(AbstractTask.java:579)
at org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute(AbstractTask.java:562)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 54 more
BUILD FAILED
UPDATE
我包含构建文件:
main build.gradle :
//顶层构建文件,您可以在其中添加对所有子项都通用的配置选项,项目/模块。
buildscript {
repositories {
jcenter()
}
ext.versions = [
android:'23 .1。 1',
anko:'0.8.2',
dokka:'0.9.6',
gradleAndroid:'1.5.0',
kotlin:'1.0.0' ,
spek:'0.1.194'
]
依赖项{
classpathcom.android.tools.build:gradle:$versions.gradleAndroid
classpathorg.jetbrains.kotlin:kotlin-gradle-plugin:$ versions.kotlin
//注意:不要在这里放置您的应用程序依赖项;它们属于单个模块build.gradle文件中的
//
}
}
allprojects {
存储库{
jcenter()
code
模块 app / build.gradle :
buildscript {
存储库{
mavenLocal()
mavenCentral()
jcenter()
}
依赖项{
classpathcom.android.tools.build :gradle:$ versions.gradleAndroid
classpathorg.jetbrains.dokka:dokka-gradle-plugin:$ {versions.dokka}
}
}
apply plugin:'org.jetbrains.dokka'
apply plugin:'com.android.application'
apply plugin:'kotlin-android'
apply plugin:'kotlin -android-extensions'
仓库{
jcenter()
maven {
urlhttp://repository.jetbrains.com/all
}
}
android {
sourc eCompatibility = 1.5
compileSdkVersion 23
buildToolsVersion23.0.2
defaultConfig {
applicationIdcom.example
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName1.0
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
buildTypes {
debug {
testCoverageEnabled true
}
}
}
sourceSets {
main.java.srcDirs + ='src / main / kotlin'
test.java.srcDirs + = 'src / test / kotlin'
}
}
依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
编译com.android.support:appcompat-v7:$versions.android
compilecom.an droid.support:design:$versions.android
compilecom.android.support:cardview-v7:$versions.android
compileorg.jetbrains.kotlin:kotlin- stdlib:$ versions.kotlin
compileorg.jetbrains.anko:anko-common:$ versions.anko
compileorg.jetbrains.anko:anko-sdk15:$ versions .anko
compileorg.jetbrains.anko:anko-support-v4:$ versions.anko
compileorg.jetbrains.anko:anko-design:$ versions.anko
编译org.jetbrains.anko:anko-appcompat-v7:$ versions.anko
compileorg.jetbrains.anko:anko-cardview-v7:$ versions.anko
compileorg .jetbrains.anko:anko-recyclerview-v7:$ versions.anko
compileorg.jetbrains.anko:anko-gridlayout-v7:$ versions.anko
testCompileorg .jetbrains.spek:spek:$ versions.spek
testCompileorg.jetbrains.kotlin:kotlin-stdlib:$ versions.kotlin
dokka {
解决方案试试Kotlin 1.0.0 版本,最新的Dokka 0.9.7 。你有一个不匹配的地方。 Gradle和Dokka版本的Kotlin插件必须兼容。如果您继续发生冲突,则可能是您的另一个插件与这些插件冲突。
Dokka 0.9.8 或更新版不会再与Kotlin编译器版本冲突(如果不同)。它现在包含它需要嵌入的内容作为阴影依赖来避免冲突。
I'm following the gradle plugin section in https://github.com/Kotlin/dokka .
I also tried the dokka-gradle-example example in https://github.com/JetBrains/kotlin-examples/tree/master/gradle/dokka-gradle-example .
The versions I'm using are:
android: '23.1.1' dokka: '0.9.6' gradle-android-plugin: '1.5.0' kotlin: '1.0.0-rc-1036'but I also tried with Dokka versions from 0.9 up to 0.9.7.
The relevant parts of the output are:
... :app:dokka FAILED :app:dokka (Thread[Daemon worker Thread 9,5,main]) completed. Took 0.766 secs. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:dokka'. > com.intellij.mock.MockComponentManager.getPicoContainer()Lorg/picocontainer/MutablePicoContainer; * Try: Run with --debug option to get more log output. * Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:dokka'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62) at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:47) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34) at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:35) at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24) at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33) at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:71) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:69) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:69) at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34) at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:70) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34) at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) at org.gradle.launcher.daemon.server.exec.DaemonHygieneAction.execute(DaemonHygieneAction.java:39) at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:119) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:46) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246) at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64) Caused by: java.lang.NoSuchMethodError: com.intellij.mock.MockComponentManager.getPicoContainer()Lorg/picocontainer/MutablePicoContainer; at org.jetbrains.dokka.AnalysisEnvironment.createCoreEnvironment(AnalysisEnvironment.kt:78) at org.jetbrains.dokka.Utilities.DokkaModule.configure(DokkaModule.kt:50) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340) at com.google.inject.spi.Elements.getElements(Elements.java:110) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) at com.google.inject.Guice.createInjector(Guice.java:96) at com.google.inject.Guice.createInjector(Guice.java:73) at com.google.inject.Guice.createInjector(Guice.java:62) at org.jetbrains.dokka.DokkaGenerator.generate(main.kt:160) at org.jetbrains.dokka.gradle.DokkaTask.generate(main.kt:63) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211) at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579) at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61) ... 54 more BUILD FAILEDUPDATE
I'm including the build files:
main build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } ext.versions = [ android: '23.1.1', anko: '0.8.2', dokka: '0.9.6', gradleAndroid: '1.5.0', kotlin: '1.0.0', spek: '0.1.194' ] dependencies { classpath "com.android.tools.build:gradle:$versions.gradleAndroid" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } }Module app/build.gradle:
buildscript { repositories { mavenLocal() mavenCentral() jcenter() } dependencies { classpath "com.android.tools.build:gradle:$versions.gradleAndroid" classpath "org.jetbrains.dokka:dokka-gradle-plugin:${versions.dokka}" } } apply plugin: 'org.jetbrains.dokka' apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' repositories { jcenter() maven { url "http://repository.jetbrains.com/all" } } android { sourceCompatibility = 1.5 compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } buildTypes { debug { testCoverageEnabled true } } } sourceSets { main.java.srcDirs += 'src/main/kotlin' test.java.srcDirs += 'src/test/kotlin' } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile "com.android.support:appcompat-v7:$versions.android" compile "com.android.support:design:$versions.android" compile "com.android.support:cardview-v7:$versions.android" compile "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin" compile "org.jetbrains.anko:anko-common:$versions.anko" compile "org.jetbrains.anko:anko-sdk15:$versions.anko" compile "org.jetbrains.anko:anko-support-v4:$versions.anko" compile "org.jetbrains.anko:anko-design:$versions.anko" compile "org.jetbrains.anko:anko-appcompat-v7:$versions.anko" compile "org.jetbrains.anko:anko-cardview-v7:$versions.anko" compile "org.jetbrains.anko:anko-recyclerview-v7:$versions.anko" compile "org.jetbrains.anko:anko-gridlayout-v7:$versions.anko" testCompile "org.jetbrains.spek:spek:$versions.spek" testCompile "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin" } dokka { }解决方案Try Kotlin 1.0.0 release, with latest Dokka 0.9.7. You have a mismatch there. The Kotlin plugin for Gradle and the Dokka versions must be compatible. If you continue to have a conflict, it could be that you have another plugin conflicting with those.
Dokka 0.9.8 or newer no longer will conflict with the Kotlin compiler version if different. It now contains what it needs embedded as shaded dependencies to avoid conflicts.
这篇关于无法让dokka在gradle / android项目上生成kotlin文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!