I’m writing a Kotlin Multiplatform project in Android Studio. As a result, I have multiple sourceSets configured in the project but some of them are empty. Removing them from the Gradle build is not possible as they are required for building the project. Is there a way to hide them from being displayed by the IDE?
(Android Studio Dolphin | 2021.3.1 Patch 1)
3
Answers
Click the dropdown at the top labeled "Android" and select the "Project" view instead. This will display only the directories that are actually present on the filesystem rather than showing every source set that’s configured.
There is no built-in way to hide empty source sets, but you can create a custom annotation to do this.
Here is the Example. I Hope It would help you.
For more details about annotations check this link:
https://kotlinlang.org/docs/annotations.html
Unfortunately there is no such option built-in in Android Studio environment.
It’s also possible to use a different view (e.g. Project) or define bookmarks and favourites to navigate around quickly.
I would advise to try out the favourites, as setting up will take about 3 minutes and will make it way more comfortable to use.