2

I'm getting this warn/error on my gradle project: 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.

Im not fully familiarized with Gradle, I searched for errors like this and just found these things on Android enviroments, but I'm using just Kotlin and some libs.

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"
}

Well, how do I fix this error/warning message? I'm not sure about it, but I think it started to appear when I added Dokka (Kotlin documentation tool)

NathanPB
  • 685
  • 1
  • 7
  • 22
  • 1
    refer https://stackoverflow.com/questions/28668252/android-studio-error-unsupported-modules-detected-compilation-is-not-supported – sasikumar Dec 26 '18 at 06:01
  • I already tried everything described on that question you just sent me, the problem persist – NathanPB Dec 26 '18 at 06:08
  • Possible duplicate of [Android studio Error "Unsupported Modules Detected: Compilation is not supported for following modules"](https://stackoverflow.com/questions/28668252/android-studio-error-unsupported-modules-detected-compilation-is-not-supported) – WiRa Sep 05 '19 at 11:27

2 Answers2

1

A suggested fix for Intellij IDEA worked for me - for pure Kotlin work (excludes any Android crossover work):

File -> Settings -> Plugins -> Installed Tab -> uncheck "Android Support"

And the log event is gone ... (h/t Joern Mangels)

https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000404920/comments/360000086479

Jim Andreas
  • 1,557
  • 1
  • 17
  • 29
1

1- close the project

2- close Android Studio IDE

3- delete the .idea directory

4- delete all .iml files

5- open Android Studio IDE and import the project