Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio not showing source set when adding new resource file

When I try to add a new resource file (ie. File>New>Android Resource File) "Source set: " is missing. Does anyone have any ideas why that could be?

like image 639
David Avatar asked Mar 12 '17 09:03

David


3 Answers

I also had the same problem. I couldn't solve it. But you can still manually add a source set for different flavors.

In ur project view, right click on app >> New >> Folder >> Res Folder. Then choose a specific flavor in "Target Source Set".

You can see the details here in the link https://developer.android.com/studio/build/build-variants.html.

Android Studio will create a source set for you for that flavor. Try to add whatever resource file you want manually there.

Cheers!

like image 153
Moe Han Avatar answered Oct 19 '22 05:10

Moe Han


I think it is by design -

When you add a new resource file by right clicking on the res folder, you cannot select a source set; but if you add a new resource folder first, you will be able to select a source set.

After that, just right click on the new source set and add new resource files.

like image 1
Sira Lam Avatar answered Oct 19 '22 05:10

Sira Lam


Looks like a bug. File > New > XML > Values (or Layout) Resource File does create a new resource file in the current build variant.

like image 1
MandisaW Avatar answered Oct 19 '22 06:10

MandisaW