Just a normal project with "prod" and "mock" flavors
in app/build.gradle:
sourceSets {
main.java.srcDirs += "blabla bla"
test.java.srcDirs += "blabla bla"
androidTest.java.srcDirs += "blabla bla"
prodDebug.java.srcDirs += "blabla bla"
mockDebug.java.srcDirs += "blabla bla"
prod.java.srcDirs += "blabla bla"
testProd.java.srcDirs += "blabla bla"
androidTestProd.java.srcDirs += "blabla bla"
mock.java.srcDirs += "blabla bla"
testMock.java.srcDirs += "blabla bla"
androidTestMock.java.srcDirs += "blabla bla"
}
click "run" in Android Studio :
something goes wrong:
Error:org.gradle.api.GradleException: The SourceSet 'mockDebug' is not recognized by the Android Gradle Plugin. Perhaps you misspelled something?
However, I can do "./gradlew clean build" or "./gradlew assembleProd installProdDebug"
etc.
But, if I do it in command-line, the app cannot be built completely, it can install the app on the target device, but the app will crash like "xxxx.dex"
problem.