在我的gradle项目中,我得到了这个警告/错误:Unsupported Modules Detected: Compilation is not supported for following modules: io.github.dogo-Dogo, Dogo_main, Dogo_test. Unfortunately you can't have non-Gradle Java modules and Android-Gradle modules in one project.
我并不完全熟悉Gradle,我搜索了类似这样的错误,只是在Android环境中找到了这些东西,但我只使用了Kotlin和一些库。
buildscript {
ext.kotlin_version = '1.3.11'
ext.ktor_version = '1.0.1'
ext.dokka_version = '0.9.17'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17"
}
}
plugins {
id "org.jetbrains.dokka" version '0.9.17'
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'maven'
group 'io.github.dogo'
version '1.0-SNAPSHOT'
mainClassName = "io.github.dogo.core.boot.BootKt"
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
maven {url 'https://jitpack.io'}
maven {
name = 'sponge'
url = 'https://repo.spongepowered.org/maven'
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-reflect"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "io.ktor:ktor-server-core:$ktor_version"
compile "io.ktor:ktor-server-netty:$ktor_version"
compile 'net.dv8tion:JDA:3.8.1_447'
compile 'org.mongodb:mongodb-driver:3.6.3'
compile 'org.spongepowered:configurate-json:3.6'
compile 'com.fasterxml.jackson.core:jackson-databind:2.0.1'
compile 'com.mashape.unirest:unirest-java:1.3.1'
compile 'org.slf4j:slf4j-simple:1.6.1'
compile 'org.apache.logging.log4j:log4j-core:2.11.1'
compile 'org.apache.logging.log4j:log4j-api:2.11.1'
compile 'org.jetbrains.kotlin:kotlin-script-runtime:1.3.11'
compile 'org.jetbrains.kotlin:kotlin-script-util:1.3.11'
compile 'org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.11'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.1'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
jar {
manifest {
attributes 'Main-Class': 'io.github.dogo.core.boot.BootKt'
}
from {
configurations.compile
.findAll { !it.name.endsWith('pom') }
.collect { it.isDirectory() ? it : zipTree(it) }
}
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/docs"
}
那么,我如何修复这个错误/警告消息呢?我不确定,但我想它是在我添加Dokka (Kotlin文档工具)时开始出现的
发布于 2019-01-27 13:22:54
Intellij IDEA的一个建议修复对我有效-对于纯Kotlin工作(不包括任何Android交叉工作):
文件->设置->插件-> Installed选项卡->取消选中"Android Support“
日志事件也就消失了...(h/t Joern Mangels)
https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000404920/comments/360000086479
发布于 2020-05-24 20:51:29
1-关闭项目
2-关闭Android Studio IDE
3-删除.idea目录
4-删除所有.iml文件
5-打开Android Studio IDE并导入项目
https://stackoverflow.com/questions/53926685
复制相似问题