question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apk build fails if use aapt2 option is ON with latest ApkTool (2.4.1)

See original GitHub issue
  1. Apktool Version 2.4.1
  2. Operating System MAC
  3. APK From? (My Project)

Stacktrace/Logcat

W: res/values/public.xml:1012: error: resource ‘drawable/$avd_hide_password__0’ has invalid entry name ‘$avd_hide_password__0’. Invalid character ‘$avd_hide_password__0’. W: res/values/public.xml:1013: error: resource ‘drawable/$avd_hide_password__1’ has invalid entry name ‘$avd_hide_password__1’. Invalid character ‘$avd_hide_password__1’. W: res/values/public.xml:1014: error: resource ‘drawable/$avd_hide_password__2’ has invalid entry name ‘$avd_hide_password__2’. Invalid character ‘$avd_hide_password__2’. W: res/values/public.xml:1015: error: resource ‘drawable/$avd_show_password__0’ has invalid entry name ‘$avd_show_password__0’. Invalid character ‘$avd_show_password__0’. W: res/values/public.xml:1016: error: resource ‘drawable/$avd_show_password__1’ has invalid entry name ‘$avd_show_password__1’. Invalid character ‘$avd_show_password__1’. W: res/values/public.xml:1017: error: resource ‘drawable/$avd_show_password__2’ has invalid entry name ‘$avd_show_password__2’. Invalid character ‘$avd_show_password__2’. W: res/values/public.xml: error: file failed to compile. brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1):

Steps to Reproduce Build apk using latest apktool version (2.4.1)

I saw this issue got fixed in 2.3.4 version in #1776 , But above issue is still happening. #2119 #2356 not able to get much information.

Can you please guide here

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? YES
  3. Are you using the latest apktool version? YES

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
giacomoferretticommented, Aug 5, 2020

Using the new binaries in #2370 seems to fix this problem. Tested with Apktool 2.4.2 built from source on Linux.

1reaction
shin-illuacommented, Sep 2, 2020

I have opened apktool_2.4.1.jar on Winrar, then went to prebuilt/windows, then I have replaced aapt2.exe with https://github.com/iBotPeaches/Apktool/blob/e6b18d24f5835aca09ecd40e88ef06450a95b99d/brut.apktool/apktool-lib/src/main/resources/prebuilt/windows/aapt2.exe and replace aapt2_x64.exe with https://github.com/iBotPeaches/Apktool/blob/e6b18d24f5835aca09ecd40e88ef06450a95b99d/brut.apktool/apktool-lib/src/main/resources/prebuilt/windows/aapt_64.exe (both link to the files I got from https://github.com/iBotPeaches/Apktool/pull/2370/files).

I don’t know if what I even did was right, but it still gave me the same error, so anyone could prolly help?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apktool.jar common errors and solutions - XDA Forums
I: Using Apktool 2.4.1 I: Smaling smali folder into classes.dex. ... Compile with --use-aapt2 (Use the aapt2 binary instead of appt). Last ......
Read more >
iBotPeaches/Apktool - Gitter
I decompiled an APK with APKtool, and it recompiles again, and I can install it on my phone. But when I try launching...
Read more >
Apktool - Documentation
First lets take a lesson into apk files. Apks are nothing more than a zip file containing resources and assembled java code. If...
Read more >
DexPatcher - Bountysource
AAPT: unknown option '--no-proguard-location-reference'. aapt2 link [options] -o arg ... Add a new plugin that uses apktool instead of aapt to rebuild apps....
Read more >
recompile - apktool build apk fails - Stack Overflow
In case you've been using v1 and now upgraded to v2, try manually deleting the framework file.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found