In my android project I want to add an additional sourceSet aside with the default android source sets (main, debug...)
In my build.gradle file I have tried the following:
android {
...
sourceSet {
create("shuttle")
}
....
}
unfortunately I get this error when I sync/build the project
ERROR: The SourceSet 'shuttle' is not recognized by the Android Gradle Plugin. Perhaps you misspelled something?
Any ideas how to create android source sets that will appear under src/{sourceSetName} directory like the way I see src/main?
Thanks.
Android does not allow you to define custom sourcesets anymore. The default sourcesets are: main, debug and release and if you really want another one, you could add a buildtype or a flavor for which android then creates an accompanying sourceset.
Also see my other answer: https://stackoverflow.com/a/73231777/3968618
And someone else's example: https://stackoverflow.com/a/61810433/3968618
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With