i am trying to compile app on android studio but i am getting the following error

"The SourceSet 'testLocal' is not recognized by the Android Gradle Plugin. Perhaps you misspelled something?"

i am running the following

android studio 3.1.4

build-gradle-4.4-all

here below the code used

android { compileSdkVersion 28 buildToolsVersion '28.0.3'

defaultConfig {
    applicationId "com.felkertech.n.cumulustv"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 65
    versionName '1.7.9'
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    testApplicationId 'com.felkertech.n.cumulustv.test'
}
signingConfigs {
    debug {
    }
}
buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
sourceSets { testLocal { setRoot('src/test') } }
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

dexOptions {
    jumboMode = true
}

}

any ideas or hints that could help me will be appreciated

1 Answers

0
Pedro On

Ok so i found the ansewer

the correct code should be

sourceSets { androidTest { setRoot 'src/test' } }

instead of

sourceSets { testLocal { setRoot('src/test') } }