我正在使用Dokka插件为我的 kotlin 项目生成文档
这是插件网址https://github.com/Kotlin/dokka
我已按照说明进行操作,这就是我的Project.gradle的样子
buildscript {
ext.kotlin_version = '1.1.51'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.15"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这就是我的app/build.gradle 的样子
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'org.jetbrains.dokka'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.kk.testkotlindoc"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
当我执行以下命令生成文档时
./gradlew dokka
它最初在该过程完成后下载了必要的 jar 文件,它给了我以下错误
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/KK/AndroidStudioProjects/TestkotlinDoc/app/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> java.lang.UnsupportedClassVersionError-com/android/build/gradle/AppPlugin
不支持的 major.minor 版本 52.0
但我无法确定问题是什么或我在这里错过了什么
请帮我 ..