I'm developing an android app using android studio as IDE.
My question is:
How to exclude certain files under certain directory during the process of building APK?
In my case, I want to exclude some images from building since the those files used in my project are designated to be downloaded from network in-app while during the development I hope to refer them in the layout.
After googling, I found some solutions:
Gradle 1.2: Exclude directory under resources sourceSets
How to exclude file from resources using Gradle and Android Studio?
And reference from gradle.org
Then I came up my solution in build.gradle:
sourceSets {
main {
resources.exclude '**/drawable/*'
res.exclude '**/drawable/*'
}
}
But it doesn't work, the image under res/drawable/ still shows up(before downloading).
The Android Studio version is currently 0.8.4.
Any idea would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…