4
I’m using the Android Studio 1.2.1.1
, with the Gradle 2.2.1
, and this is an excerpt (the relevant part) of my resource folder structure:
res
|- layout
|- layout-v21
|- values
|- values-v11
|- values-v13
|- values-v14
|- values-v21
|- xml
When I Go the APK with the Android SDK Build-tools 20.0.0
, this same structure is the one found inside the APK file (which can be checked by opening the APK file with various file compression programs such as the 7-zip).
However, when I switch to the Android SDK Build-tools 22.0.1
, the folder structure within the APK looks like this one below:
res
|- layout
|- layout-v11
|- layout-v21
|- values
|- values-v11
|- values-v13
|- values-v14
|- values-v21
|- xml
|- xml-v14
|- xml-v17
Detail for the 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, leaves me worried. What am I doing wrong? Is there any new configuration in the version 22.0.1
?
For now, I solved the "problem" just by staying with the version 20.0.0
, but would like to know how to solve this, to migrate to the newer version, without folders and resources appearing in APK.
Updating
After much internet search (unsuccessful) and many tests, I believe I have discovered what makes the Android SDK Build-tools 22.0.1
"invent" such folders in APK.
I ran some initial tests on the folders layout
and layout-v21
. Among all XML files inside the folder layout
, 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.
Thus, it seems, during the generation of the APK, the Android SDK Build-tools 22.0.1
kept a copy of my layouts removing attributes mentioned, and created a folder layout-v11
where he kept the layouts with the attributes, the way I created them.
This behavior is strange, because the IDE itself says it’s not wrong to keep new attributes in layouts that will be used with old Apis (she says, and I’ve tested it numerous times: devices with old Apis simply ignore these attributes silently).
I did not add this as an answer because I still need to perform further tests to confirm this theory.
I may be mistaken, but this happens as a kind of backup and compatibility, but it’s been a while since I work with Android (so much so that I used Eclipse at the time)
– Guilherme Nascimento
@And you know how to disable this in Android Studio?
– carlosrafaelgn
I’m not sure, but I don’t think this is "disabled", I can’t say for sure, but until Sunday I install androidstudio and will test :)
– Guilherme Nascimento
@Guillhermenascimento reached some conclusion? :)
– carlosrafaelgn
carlos my internet is not helping rs, I’m still downloading :( I thought my colleague had himself the androidstudio, but he only had the eclipse
– Guilherme Nascimento