Ωmega
Ωmega

Reputation: 43673

Compiled APK file contains a lot of unknown (A)XML layouts

When I unzip the apk file, in the res\layout folder I found the following unknown xml files:

abc_action_bar_title_item.xml
abc_action_bar_up_container.xml
abc_action_menu_item_layout.xml
abc_action_menu_layout.xml
abc_action_mode_bar.xml
abc_action_mode_close_item_material.xml
abc_activity_chooser_view.xml
abc_activity_chooser_view_list_item.xml
abc_alert_dialog_button_bar_material.xml
abc_alert_dialog_material.xml
abc_alert_dialog_title_material.xml
abc_cascading_menu_item_layout.xml
abc_dialog_title_material.xml
abc_expanded_menu_layout.xml
abc_list_menu_item_checkbox.xml
abc_list_menu_item_icon.xml
abc_list_menu_item_layout.xml
abc_list_menu_item_radio.xml
abc_popup_menu_header_item_layout.xml
abc_popup_menu_item_layout.xml
abc_screen_content_include.xml
abc_screen_simple.xml
abc_screen_simple_overlay_action_mode.xml
abc_screen_toolbar.xml
abc_search_dropdown_item_icons_2line.xml
abc_search_view.xml
abc_select_dialog_material.xml
abc_tooltip.xml
notification_template_part_chronometer.xml
notification_template_part_time.xml
select_dialog_item_material.xml
select_dialog_multichoice_material.xml
select_dialog_singlechoice_material.xml
support_simple_spinner_dropdown_item.xml

None of them is my layout file. My layout xml file were there also, but all above listed are unknown to me.

Why are those files in my apk file? Do I need them there? Or is there a way to not having them in my apk file and have my apk file smaller?

Upvotes: 2

Views: 443

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006674

Why are those files in my apk file?

You are using AppCompat, or at least added it as a dependency. There are some resources there that might be from other dependencies, but all the abc ones are from AppCompat.

Do I need them there?

If you are using AppCompat, yes. If not, no. If you are not using AppCompat, remove the dependency (and make sure nothing else that you are using needs AppCompat or otherwise pulls in AppCompat as a transitive dependency).

It is possible that some of those resources you will not need, even though you are using other aspects of AppCompat. You can look into the resource shrinking settings of a release build to see if it can identify some to remove.

Or is there a way to not having them in my apk file and have my apk file smaller?

You could not use AppCompat. In modern Android app development, that is rather difficult.

Upvotes: 3

Related Questions