Apktool: Error parsing XML: not well-formed (invalid token)

Original issue 776 created by kefir500 on 2015-03-04T10:57:38.000Z:

What steps will reproduce the problem?

What is the expected output? What do you see instead?

warning: string 'pref_map_show_center_cross' has no default translation.
warning: string 'pref_map_show_center_cross_desc' has no default translation.

C:\Apktool\res\layout\abc_action_menu_layout.xml:2: error: Error parsing XML: not well-formed (invalid token)

C:\Apktool\res\layout\abc_action_mode_bar.xml:2: error: Error parsing XML: not well-formed (invalid token)

C:\Apktool\res\layout\abc_activity_chooser_view.xml:2: error: Error parsing XML: not well-formed (invalid token)

— And 5 more similar errors —

C:\Apktool\res\layout\fragment_track_record.xml:24: error: No resource identifier found for attribute 'pw_text' in package 'android'

C:\Apktool\res\layout\fragment_track_record.xml:24: error: No resource identifier found for attribute 'pw_textSize' in package 'android'

C:\Apktool\res\layout\fragment_track_record.xml:24: error: No resource identifier found for attribute 'pw_barColor' in package 'android'

– And >10 similar errors —

C:\Apktool\res\layout\view_color_picker_basic_tab.xml:5: error: Error parsing XML: duplicate attribute

What version of the product are you using? On what operating system?

  • Apktool RC4
  • aapt.exe (from the Apktool GitHub repository)

Please provide any additional information below. Seems that XML tags are corrupt. Tried to fix these XML tags manually - no luck. Also tried different aapt and Apktool releases - still the same. Removing "framework/1.apk" does not help.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

though this issue is closed, I recently encountered this behavior with apktool 2.4.1

to summarize, the problem traced back to the fact that the decoded apk contained smali filenames with unicode characters.

as a workaround, I wrote a small nodejs command-line utility to rename all smali unicode filenames, and remap all references elsewhere in the project.

wrote it in a day… might not solve everyone’s woes, but I hope that some may find it useful; worked for me.

Would it be possible to work around this by just renaming the classes to unique [a-Z*] names and updating the references (during/after decompilation)?