Apktool: apktool 2.4.1 error in resource packing

Information

  1. Apktool Version (apktool -version) - 2.4.1
  2. Operating System (Mac, Linux, Windows) - Windows
  3. APK From? (Playstore, ROM, Other) - https://es-file-explorer.en.uptodown.com/android/download

Stacktrace/Logcat

I: Using Apktool 2.4.1
I: Smaling smali folder into classes.dex...
I: Smaling smali_classes2 folder into classes2.dex...
I: Smaling smali_classes3 folder into classes3.dex...
I: Building resources...
W: C:\Users\rawat\Desktop\aman1\esfile\res\values\public.xml:2940: error: resource 'drawable/$avd_hide_password__0' has invalid entry name '$avd_hide_password__0'. Invalid character '$avd_hide_password__0'.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values\public.xml:2941: error: resource 'drawable/$avd_hide_password__1' has invalid entry name '$avd_hide_password__1'. Invalid character '$avd_hide_password__1'.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values\public.xml:2942: error: resource 'drawable/$avd_hide_password__2' has invalid entry name '$avd_hide_password__2'. Invalid character '$avd_hide_password__2'.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values\public.xml:2943: error: resource 'drawable/$avd_show_password__0' has invalid entry name '$avd_show_password__0'. Invalid character '$avd_show_password__0'.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values\public.xml:2944: error: resource 'drawable/$avd_show_password__1' has invalid entry name '$avd_show_password__1'. Invalid character '$avd_show_password__1'.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values\public.xml:2945: error: resource 'drawable/$avd_show_password__2' has invalid entry name '$avd_show_password__2'. Invalid character '$avd_show_password__2'.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values\public.xml:2953: error: resource 'drawable/$ic_launcher_foreground__0' has invalid entry name '$ic_launcher_foreground__0'. Invalid character '$ic_launcher_foreground__0'.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values-v21\styles.xml:78: error: expected reference but got (raw string) true.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values-v21\styles.xml:87: error: expected reference but got (raw string) true.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values-v21\styles.xml:100: error: expected dimension but got (raw string) true.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values-v21\styles.xml:104: error: expected reference but got (raw string) true.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values-v21\styles.xml:105: error: expected reference but got (raw string) false.
W: C:\Users\rawat\Desktop\aman1\esfile\res\values-v21\styles.xml:113: error: expected float but got (raw string) 3.0dip.
W: error: failed linking references.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\rawat\AppData\Local\Temp\brut_util_Jar_4032101392738594028.tmp, link, -o, C:\Users\rawat\AppData\Local\Temp\APKTOOL3975565721024851697.tmp, --package-id, 127, --min-sdk-version, 17, --target-sdk-version, 26, --version-code, 10058, --version-name, 4.2.1.9, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -e, C:\Users\rawat\AppData\Local\Temp\APKTOOL620741681139156457.tmp, -0, arsc, -I, C:\Users\rawat\AppData\Local\apktool\framework\1.apk, --manifest, C:\Users\rawat\Desktop\aman1\esfile\AndroidManifest.xml, C:\Users\rawat\Desktop\aman1\esfile\build\resources.zip]

Steps to Reproduce

  1. apktool d esfile.apk
  2. apktool b esfile.apk

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes
  2. If you are trying to install a modified apk, did you resign it? nill
  3. Are you using the latest apktool version? Yes

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

apktool 2.4.1 error and this tool really needs to improve.

You know its open source and free right? You are welcome to contribute.

Hey people,

The issue is not reproduced with the steps in the description.

  1. Apktool Version (apktool --version) - 2.4.1
  2. Operating System - Windows
  3. APK From (Playstore, ROM, Other) - https://es-file-explorer.en.uptodown.com/android/download

See my log:

PS C:\Users\user\Downloads> apktool d .\es-file-explorer-4-2-1-9.apk
I: Using Apktool 2.4.1 on es-file-explorer-4-2-1-9.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\user\AppData\Local\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes2.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...


PS C:\Users\user\Downloads> apktool b .\es-file-explorer-4-2-1-9
I: Using Apktool 2.4.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...
PS C:\Users\user\Downloads>

This open issue really misled me cause I wasted a lot time with a bit older apktool thinking the issue is still not fixed.

Best Regards Alex

Thanks a lot for solving my issue.

AOSP_10_framework-res.zip

I got it from a build of stock AOSP that was shared on xda a little while ago. And I’ve attached it to this post for you.