Search code examples
gradlejava-8gradlewjava-13

Gradle execution failed for task ‘:test’ when changing sourceCompatibility and targetCompatibility from 1.8 to 13


Following error occurs when migrating from source and target compatibility from 1.8 to 13 FAILURE: Build failed with an exception. What went wrong: Execution failed for task ‘:test’. Failed to read class file C:\Users\FixedSizeFifoDoubleArrayTest.class

Tried changing sourceCompatibility = 1.8 targetCompatibility = 13


Solution

  • Add the following code

    tasks.withType(Test){
    scanForTestClasses = false
    include "**/*Test.class"
     }
    

    to build.gradle file as described in the below link

    Execution failed for task ‘:test’ when changing sourceCompatibility and targetCompatibility from 1.8 to 13