I\'m trying to compile my Android project in Android Studio 0.3.0. Today I get the following error:
Exception in thread \"main\" java.lang.NoClassDefFoundErr
All the answers are good-
Make sure you have sourceSets have the test directory registered.
android{
...
defaultConfig {
...
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
sourceSets {
androidTest {
java.srcDirs = ['src/androidTest/java']
}
}
}
dependencies{
...
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:0.5'
}