I'm writing game using Kotlin and LibGDX framework. I'm new to testing. I have passed some basic tutorial how to create simple test. And how to configure gradle. I just clicked on class and choose create test.
But, when i try to build project i get an error:
e: /Users/maximternovtsi/bagel/core/src/test/test/BagelTest.kt: (1, 12): Unresolved reference: junit
e: /Users/maximternovtsi/bagel/core/src/test/test/BagelTest.kt: (2, 12): Unresolved reference: junit
e: /Users/maximternovtsi/bagel/core/src/test/test/BagelTest.kt: (6, 6): Unresolved reference: Test
e: /Users/maximternovtsi/bagel/core/src/test/test/BagelTest.kt: (8, 9): Unresolved reference: Assertions
e: /Users/maximternovtsi/bagel/core/src/test/test/BagelTest.kt: (11, 6): Unresolved reference: Test
e: /Users/maximternovtsi/bagel/core/src/test/test/BagelTest.kt: (13, 9): Unresolved reference: Assertions
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':core:compileKotlin'.
BagelTest looks like this:
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.BeforeEach
internal class BagelTest {
#BeforeEach
internal fun setUp() {
}
#Test
internal fun passes() {
assert(true)
}
}
I guess that gradle doesn't see junit, but i followed all instructions. Maybe i missed something.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'org.multi-os-engine:moe-gradle:1.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.51"
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "Bagel"
gdxVersion = '1.9.8'
junitJupiterVersion = '5.0.2'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "kotlin"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
}
}
project(":android") {
apply plugin: "android"
apply plugin: "kotlin-android"
configurations { natives }
dependencies {
compile project(":core")
compile "org.jetbrains.kotlin:kotlin-stdlib:1.1.51"
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86_64"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
}
}
project(":core") {
apply plugin: "kotlin"
/*kotlin {
experimental {
coroutines 'enable'
}
}*/
sourceSets.test.java.srcDirs = ["/test"]
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib:1.1.51"
compile "com.badlogicgames.ashley:ashley:1.7.3"
testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
// testCompile "org.mockito:mockito-core:2.2.7"
}
}
tasks.eclipse.doLast {
delete ".project"
}
I've configured junit tests for libGdx+kotlin by following steps:
Create 'test' folder in the core project folder - it will be the root folder for test code files: [project-root]/core/test
Add junit dependencies in project main gradle.build file to the project(":core") section:
project(":core") {
....
dependencies {
...
testCompile 'junit:junit:4.12'
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
}
}
Add test source set in [project-root]/core/build.gradle file, right under the 'sourceSets.main.java.srcDirs = [ "src/" ]' line:
sourceSets.test.java.srcDirs = ["test/"]
Now the [project-root]/core/test folder will be highlighted with green, which means that this folder is recognized as test source directory. Now you can place there a .kt file with simple junut test, for example:
import org.junit.Test
import kotlin.test.assertEquals
class SimpleTest{
#Test
fun testEquals(){
var b=true
assertEquals(true,b)
}
}
In my case problem was I didn't import
androidTestImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
Update May 2020: This should be placed in build.gradle's dependencies { }. As of Android Studio version 4 and current gradle version, the variable should be named $version_kotlin for gradle to properly re-sync.
in app module's build.gradle
replace testImplementation
with
androidTestImplementation
First make sure that the kotlin version defined in build.gradle.kts (project) is the same as the selected in the compiler.
plugins {
kotlin("jvm") version "1.4.21" apply false
}
If these versions are matting and still not working then proceed with the following steps:
Delete all cache folders including:
.gradle
.idea
Invalidate Caches / Restart...
Open any gradle file (settings.gradle.kts)
In the IDE at the top right click in Link Gradle project
Finally, specifies that JUnit 5 should be used to execute the tests
build.gradle.kts
tasks.test {
useJUnitPlatform()
}
Note: This behavior can be defined by gradle or from the IDE
It is very likely that if it worked and you have the dependencies it is a cache problem or gradle configuration.
GL
You should:
1) remove internal word - it is not required
2) using simple assert method in tests is wrong - use methonds from org.junit.Assert.*
I am using Android Studio 4.0 version and there is (test) package already in the android project it's a default package , I have put my kotlin test file there and there is no problem with it. I didn't run the file yet but there are no import errors for junit etc. I hope this is helpful.
Related
I'm trying use Rxjava and I added it my gradle like so:
However, I'm not able to use it from within my src directory -- the autocomplete doesn't show any suggestions for Observable.
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'application'
sourceCompatibility = 1.8
version = '1.0'
repositories {
flatDir {
dirs 'lib'
}
}
sourceSets {
test {
java {
srcDir 'src/test/java'
}
}
}
dependencies {
testCompile 'org.hamcrest:hamcrest-core:1.3'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:1.7.1'
testCompile 'io.reactivex:rxjava:1.0.7'
testCompile 'io.reactivex:rxjava-math:1.0.0'
testCompile 'io.reactivex:rxjava-string:0.22.0'
compile 'io.reactivex.rxjava2:rxjava:2.2.0'
}
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.2.1'
}
I want to be able to use the dependency from within my source directory.
Once you add a dependency to a build.gradle file you need to build the gradle project. This downloads all the dependencies and then the autocomplete will show the suggestion.
In Eclipse you can do the following:
Right Click on Project module-> Gradle->Refresh Gradle project
Otherwise from command prompt you can use the following command:
gradlew build
I would like to know what am I doing wrong in the Lombok setup for Android Studio 3.0 Beta 2?
That's how my Gradle build file looks like:
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "io.franzbecker:gradle-lombok:1.10"
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "MyAppName"
gdxVersion = '1.7.0'
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
}
}
project(":core") {
apply plugin: "io.franzbecker.gradle-lombok"
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
compileOnly "org.projectlombok:lombok:1.16.18"
}
}
tasks.eclipse.doLast {
delete ".project"
}
I have installed the lombok plugin, and lombok stuff also shows up properly in the IDE, but when I want to build the project Gradle can not find the getters/setters created by Lombok. I tried to follow the tutorials from https://projectlombok.org/setup/android and other stack overflow pages about this setup, but nothing worked. In Android Studio 2.3 I couldn't even enable the annotation processing properly, that's why I updated to the latest beta version, where that at least works.
I have the same issue. At last I end up with this solution -
compileOnly 'org.projectlombok:lombok:1.16.18'
compileOnly 'javax.annotation:javax.annotation-api:1.3.1'
annotationProcessor 'org.projectlombok:lombok:1.16.18'
You need to use new annotationProcessor instead of apt : Gradle migration annotationProcessor
annotationProcessor "org.projectlombok:lombok:1.16.18"
I had the same problem as you and now it works.
I was facing the same issue where upgrading AS to 3.0 and Gradle to 4.1, lombok stopped generating setters/getters.
So If you are using lombok plugin with IntelliJ then for me downgrading lombok from latest stable edge release to 0.15.17.2 solved it.
This issue helped me solving it
Alright I have been working on this for almost a week and it is getting annoying now. My project compiles in desktop mode perfectly all the time, the Android version works fine until I start intergrating Google play services. I understand it is a duplicate somewhere, have tried deleting the build and having it remade, have tried various other solutions but to no avail. Here is my gradle build file. I have included the GameHelper as a class in my module.
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = "Collide_5"
gdxVersion = '1.7.0'
roboVMVersion = '1.8.0'
box2DLightsVersion = '1.4'
ashleyVersion = '1.6.0'
aiVersion = '1.6.0'
}
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
compile "com.google.android.gms:play-services:8.3.0"
}
}
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "net.dermetfan.libgdx-utils:libgdx-utils-box2d:0.13.1"
compile "net.dermetfan.libgdx-utils:libgdx-utils:0.13.1"
compile "com.underwaterapps.overlap2druntime:overlap2d-runtime-libgdx:0.1.0"
}
}
tasks.eclipse.doLast {
delete ".project"
Well to get rid of the error I started a new Libgdx project from scratch and added BasegameUtils(Base) as a library project and DID NOT add Google Game Services as a dependency, since it is a dependency in Base. I made Base a library dependency compile in the Android project. I am able to report so far so good, now all that I have to do is add to the project, are the individual Google services required. What I have done so far is add an interface to the core package and integrated that into my Android and Desktop project. I still have other issues I am working on, but the problem of the dex failure on Android builds is gone.
Context
I have started a personal project in java with Gradle as the build system and I want to use Dagger 2 as a DI. The main reason of doing that is to get used to that library and be able to use it easily in bigger projects.
What have I tried
I've managed to make the Google sample runs on IntelliJ IDEA
Problem
IntelliJ IDEA keeps telling me that it cannot resolve the generated class (in this case DaggerCoffeeApp_Coffee). It's a bit annoying not to know if the written code is correct (specially when you are learning to use Dagger 2).
All java classes are the same as the Google sample. Here is my build.gradle file:
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'com.google.dagger:dagger:2.0.1'
compile 'com.google.dagger:dagger-compiler:2.0.1'
}
Question
Is there any way to make IntelliJ IDEA recognize DaggerCoffeeApp_Coffee as a generated class (and so make it possible to go to its implementation by `ctrl + left click)?
Simplest way I found:
Add idea plugin and add Dagger2 dependency like below:
plugins {
id "net.ltgt.apt" version "0.10"
}
apply plugin: 'java'
apply plugin: 'idea'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'com.google.dagger:dagger:2.11'
apt 'com.google.dagger:dagger-compiler:2.11'
}
Turn on Annotation Processing for IntelliJ: Go to Settings and search for Annotation Processors, check Enable annotation processing like below image:
Finally I made it!
I had to add the apt and the idea plugin so right now my build.gradle file look like this:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.4"
}
}
apply plugin: "net.ltgt.apt"
apply plugin: 'java'
apply plugin: 'idea'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'com.google.dagger:dagger:2.0.1'
apt 'com.google.dagger:dagger-compiler:2.0.1'
}
you must manually enable the annotation processing in IntelliJ.
From: Settings --> Build, Execution, Deployment --> Compiler --> Annotation Processors --> Enable annotation processing and Obtain processors from project classpath
then rebuild the project and you will find the generated classes in the project.
Please note that I have used this solution in a (java) android project.
I'm using version 2017.3.3 of IntelliJ IDEA, version 0.14 of the net.ltgt.apt plugin and version 2.14.1 of Dagger and as well as applying the idea plugin in the build.gradle file (as in Pelocho's answer) I found I also had to tell IntelliJ where it can find the sources generated by Dagger, as follows:
apply plugin: 'idea'
idea {
module {
sourceDirs += file("$buildDir/generated/source/apt/main")
testSourceDirs += file("$buildDir/generated/source/apt/test")
}
}
This is what I had to do in order to get Idea to work with Dagger2 and gradle.
Turn on annotation processing as shown in the answers above.
Add the following to the build.gradle file in order for Idea to see the generated classes as sources.
sourceDirs += file("$projectDir/out/production/classes/generated/")
Here's the full listing of my build.gradle
plugins {
id 'java'
id 'idea'
id "net.ltgt.apt" version "0.10"
}
idea {
module {
sourceDirs += file("$projectDir/out/production/classes/generated/")
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.dagger:dagger:2.16'
apt 'com.google.dagger:dagger-compiler:2.16'
}
sourceCompatibility = 1.8
Also, I had to add the following gradle task (to my build.gradle file) to clear out my out directory. When I moved some files around and Dagger2 regenerated the source files, the out directory wasn't being cleared out :(. I also included this task in my run configuration, so that it gets triggered before I rebuild my project.
task clearOutFolder(type: Delete) {
delete 'out'
}
Here's the solution that worked for me:
File -> Project Structure -> (select your project under list of modules) -> Open 'Dependencies' tab
Then, click on green '+' sign, select 'JARs or directory' and select 'build/classes/main' folder.
Another solution would be to link folder with build class files using 'dependencies' block inside build.gradle:
https://stackoverflow.com/a/22769015/5761849
Using IntelliJ IDEA 2019.1 and Gradle 5.4.1, this seems to be enough:
plugins {
id 'java'
}
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.12'
implementation 'com.google.dagger:dagger:2.23.1'
annotationProcessor 'com.google.dagger:dagger-compiler:2.23.1'
}
I don't know the minimal versions for which this solution works, though.
I had a similar problem, I could not find out the cause for a long time.
Just launched and the result surprised me.
Intellij Idea 2018.3.6 -
build.gradle:
plugins {
id "java"
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile 'com.google.dagger:dagger:2.11'
apt 'com.google.dagger:dagger-compiler:2.11'
}
The following worked for me on IntelliJ 2021.3.3 (UE)
plugins {
id 'java'
id 'idea'
id("com.github.johnrengelman.shadow") version "7.1.2"
}
idea {
module {
sourceDirs += file("$projectDir/build/generated/sources/annotationProcessor/java/main")
testSourceDirs += file("$projectDir/build/generated/sources/annotationProcessor/java/test")
}
}
group 'com.codigomorsa'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
annotationProcessor 'com.google.dagger:dagger-compiler:2.44'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'com.google.dagger:dagger:2.44'
testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.44'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
}
test {
useJUnitPlatform()
}
I'm trying to add jacoco support to my gradle project, but when I add the jacoco plugin, it gives me an error.
Here is my gradle.build
task wrapper(type: Wrapper) { gradleVersion = '1.11' }
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'war'
apply plugin: 'eclipse'
apply plugin: 'eclipse-wtp'
apply plugin: 'application'
apply plugin: 'project-report'
apply plugin: 'jacoco'
eclipse {
classpath { downloadSources=true }
}
eclipse.classpath.file {
// Classpath entry for Eclipse which changes the order of classpathentries; otherwise no sources for 3rd party jars are shown
withXml { xml ->
def node = xml.asNode()
node.remove( node.find { it.#path == 'org.eclipse.jst.j2ee.internal.web.container' } )
node.appendNode( 'classpathentry', [ kind: 'con', path: 'org.eclipse.jst.j2ee.internal.web.container', exported: 'true'])
}
}
tasks.withType(Compile) { options.encoding = 'UTF-8' }
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
providedCompile 'javax.servlet:servlet-api:2.5'
runtime 'javax.servlet:jstl:1.1.2'
compile 'org.springframework.batch:spring-batch-core:2.2.5.RELEASE'
compile 'org.springframework:spring-webmvc:4.0.2.RELEASE'
compile 'org.springframework:spring-jdbc:4.0.2.RELEASE'
compile 'org.springframework:spring-orm:4.0.2.RELEASE'
compile 'org.springframework.data:spring-data-mongodb:1.4.0.RELEASE'
compile 'org.springframework.security:spring-security-web:3.2.1.RELEASE'
compile 'org.springframework.security:spring-security-config:3.2.1.RELEASE'
compile 'org.slf4j:slf4j-simple:1.6.1'
compile 'org.codehaus.groovy:groovy-all:2.2.0'
compile 'org.mongodb:mongo-java-driver:2.11.4'
compile 'c3p0:c3p0:0.9.1.2'
compile 'org.hibernate:hibernate-core:4.3.4.Final'
compile 'org.hibernate:hibernate-ehcache:4.3.4.Final'
compile 'org.hsqldb:hsqldb:2.0.0'
compile 'com.google.guava:guava:16.0'
compile 'commons-io:commons-io:2.4'
compile 'com.google.code.gson:gson:2.2.4'
compile 'org.codehaus.jackson:jackson-core-asl:1.9.13'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
testCompile 'junit:junit:4.11'
testCompile 'commons-collections:commons-collections:3.2'
testCompile 'org.springframework:spring-test:4.0.2.RELEASE'
testCompile 'org.codehaus.groovy:groovy-all:2.2.0'
testCompile 'de.flapdoodle.embed:de.flapdoodle.embed.mongo:1.35'
testCompile 'org.springframework.batch:spring-batch-test:2.2.5.RELEASE'
compile localGroovy()
}
test {
testLogging { // Show that tests are run in the command-line output
events 'started', 'passed' }
exclude 'com/bambilon/All*'
exclude 'com/bambilon/**/slow/*'
}
and when I run refresh dependencies in Eclipse, it gives me this error:
Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'jacoco' not found.
at org.gradle.api.internal.plugins.DefaultPluginRegistry.getTypeForId(DefaultPluginRegistry.java:86)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.getTypeForId(DefaultProjectsPluginContainer.java:102)
at org.gradle.api.internal.plugins.DefaultProjectsPluginContainer.apply(DefaultProjectsPluginContainer.java:37)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyPlugin(DefaultObjectConfigurationAction.java:101)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:32)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:72)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:114)
at org.gradle.api.internal.project.AbstractProject.apply(AbstractProject.java:846)
at org.gradle.api.Project$apply.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
at org.gradle.api.Script$apply.callCurrent(Unknown Source)
Please help, thanks!
I am not quite sure which version introdueced jacoco plugin but with Gradle 2.x it for sure works. If you have a $buildDir/jacoco folder after running gradle build, you can be sure that it works. More information on http://www.gradle.org/docs/current/userguide/jacoco_plugin.html.
I have also got the same problem , I have set the gradle path in eclipse .It sloved for me.To set the path
Eclipse -Window->preference-type Gardle
Click on folder radio button , and set path to gradle folder located in your system.