I'm using Android Studio 1.2.1.1
, with Gradle 2.2.1
, and this is a snippet (the relevant part) of my my resource folders structure:
res
|- layout
|- layout-v21
|- values
|- values-v11
|- values-v13
|- values-v14
|- values-v21
|- xml
When I generate the APK with Android SDK Build-tools 20.0.0
, this same structure is found inside the APK file (which can be checked by opening the APK file with several file compression programs, such as 7-zip).
However, when I change to Android SDK Build-tools 22.0.1
, the folder structure inside the APK looks like this below:
res
|- layout
|- layout-v11
|- layout-v21
|- values
|- values-v11
|- values-v13
|- values-v14
|- values-v21
|- xml
|- xml-v14
|- xml-v17
Detail for folders layout-v11
, xml-v14
and xml-v17
that are not part of my project.
This, in addition to impacting the final size of the APK file, makes me worried. what am I doing wrong? Is there a new setting in 22.0.1
?
By hour, I solved the problem by only remaining with the 20.0.0
version, but I would like to know how to resolve this, to migrate to the newer version without any folders and features appearing in APK.
Update
After a lot of internet search (unsuccessful) and many tests, I think I have figured out what causes Android SDK Build-tools 22.0.1
to "invent" those folders in APK.
I did some initial tests with the layout
and layout-v21
folders. Of all XML files within the layout
folder, some of them have elements with the following attributes:
android:splitMotionEvents
android:nextFocusForward
Both attributes belong to API 11, and the minimum API supported by my project is API 10.
So, apparently, during the APK generation, Android SDK Build-tools 22.0.1
kept a copy of my layouts by removing the mentioned attributes, and created a layout-v11
folder where you kept layouts < strong> with attributes, the way I created them.
I did not add this as an answer because I still need to run more tests to confirm this theory.