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.

Use Apktool(2.2.2) rebuild unmodified weixin6.3.7.apk found error: No resource identifier found for attribute in package 'com.tencent.mm', however V2.0.3 is ok

See original GitHub issue

Information

  1. Apktool Version (2.2.2) -
  2. Operating System (Mac) -
  3. APK From? (http://weixin.qq.com/cgi-bin/readtemplate?lang=zh_CN&t=weixin_faq_list) -

Stacktrace/Logcat

Below is use 2.2.2 version to rebuild unmodified weixin6.3.7:

W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:5: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:5: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:6: error: No resource identifier found for attribute 'persistent' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:6: error: No resource identifier found for attribute 'title' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:6: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:6: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:7: error: No resource identifier found for attribute 'title' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:7: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:7: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:9: error: No resource identifier found for attribute 'title' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:9: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:9: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:10: error: No resource identifier found for attribute 'title' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:10: error: No resource identifier found for attribute 'key' in package 'com.tencent.mm'
W:
W: /Users/yanzi/work/d-apk/weixin2/weixin637/res/xml/z.xml:10: error: No resource identifier found for attribute 'layout' in package 'com.tencent.mm'
W:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_5322325296887264747.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, --no-version-vectors, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL3485422076297709042.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, assets/emojicompactfile, -0, data, -0, svg, -0, apk, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:477)
	at brut.androlib.Androlib.buildResources(Androlib.java:411)
	at brut.androlib.Androlib.build(Androlib.java:310)
	at brut.androlib.Androlib.build(Androlib.java:263)
	at brut.apktool.Main.cmdBuild(Main.java:227)
	at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_5322325296887264747.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, --no-version-vectors, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL3485422076297709042.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, assets/emojicompactfile, -0, data, -0, svg, -0, apk, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:440)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:463)
	... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_5322325296887264747.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, --no-version-vectors, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL3485422076297709042.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, assets/emojicompactfile, -0, data, -0, svg, -0, apk, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:95)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:434)
	... 6 more

Below is use Apktool(2.0.3) log:

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/drawables.xml:165: error: invalid symbol: 'do'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/drawables.xml:358: error: invalid symbol: 'if'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/layouts.xml:165: error: invalid symbol: 'do'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/layouts.xml:341: error: invalid symbol: 'if'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/strings.xml:170: error: invalid symbol: 'do'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/strings.xml:352: error: invalid symbol: 'if'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/dimens.xml:165: error: invalid symbol: 'do'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/dimens.xml:341: error: invalid symbol: 'if'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/styles.xml:791: error: invalid symbol: 'do'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/styles.xml:2168: error: invalid symbol: 'if'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/colors.xml:165: error: invalid symbol: 'do'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/colors.xml:341: error: invalid symbol: 'if'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/ids.xml:75: error: invalid symbol: 'do'

/Users/yanzi/work/d-apk/weixin2/weixin637/res/values/ids.xml:251: error: invalid symbol: 'if'

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_4887173892981919240.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL8826980659801902946.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, , -0, data, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:472)
	at brut.androlib.Androlib.buildResources(Androlib.java:410)
	at brut.androlib.Androlib.build(Androlib.java:298)
	at brut.androlib.Androlib.build(Androlib.java:268)
	at brut.apktool.Main.cmdBuild(Main.java:225)
	at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_4887173892981919240.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL8826980659801902946.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, , -0, data, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:425)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:458)
	... 5 more
Caused by: brut.common.BrutException: could not exec command: [/var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/brut_util_Jar_4887173892981919240.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 861, --version-name, 6.3.25, -F, /var/folders/_5/kf4fq49x0795vwcnlxblvkpr0000gn/T/APKTOOL8826980659801902946.tmp, -0, arsc, -0, zip, -0, sec, -0, conf, -0, dat, -0, , -0, data, -0, arsc, -I, /Users/yanzi/Library/apktool/framework/1.apk, -S, /Users/yanzi/work/d-apk/weixin2/weixin637/res, -M, /Users/yanzi/work/d-apk/weixin2/weixin637/AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:89)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:419)
	... 6 more

You can find some do and if errors, use sed replace, and then rebuild is ok!

Steps to Reproduce

  1. apktool d weixin637.apk

  2. apktool b weixin637

APK

If this APK can be freely shared, please upload/attach a link to it. weixin6.3.7

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? I didn’t get to this step
  3. Are you using the latest apktool version? yes

Hello, I use apktool latest version(2.2.2) to decompile weixin6.3.7.apk, nothing change and then rebuild, found so much No resource identifier found for attribute in package com.tencent.mm errors. However, use apktool(2.0.3), there is no such error, after fix do and if errors, and then rebuild is ok. I have tested, from 2.1.1 version later, It will encounter No resource identifier found for attribute in package errors, which make me believe 2.0.3 version is perfect on Mac.

However , when i test on Windows7, I found 2.1.1 is the last ok version for weixin6.3.7.apk on Windows. So it make me very depressed。

Different with 1421, the attribute is definited by package com.tencent.mm, not android standard package.

Thanks for your help!

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
hereisderekcommented, Nov 27, 2019

from what I understand, there’s no easy way to work out the obfuscation, however, you can work around it by skipping decompiling resources with -r when decompiling

2reactions
andykaiscommented, Jul 27, 2021

just a suggestion, could we add an option to selectively decode some of the resources? For instance, I get tons of “No resource identifier found for attribute” errors on layout resources, but all I need to do is edit res/xml/network_security_config.xml

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: no resource identifier found for attribute apktool
Use Apktool (2.2.2) rebuild unmodified weixin6.3.7.apk found error: No resource identifier found for attribute in package 'com.tencent.mm', however V2.0.3 is ...
Read more >
When I'm Recompiling The apk This Error Shows in apktool ...
First thing to do is copy/paste the error listed at the end into the browser to see what you can find. Your error...
Read more >
INZ APKTool 2.0 (Windows GUI APK Tool) - XDA Forums
INZ APKTool 2.0 (Another APK GUI Tool) Easy and Small Application (Windows GUI), ... error: No resource identifier found for attribute ...
Read more >
iBotPeaches / Apktool / Downloads - Bitbucket
Name Size Uploaded by Downloads Date Download repository 283.8 MB 283.8 MB 283.8 MB 283.8 MB apktool_2.7.0.jar 22.1 MB Connor Tumbleson 28884 2022‑11‑24 apktool_2.6.1.jar 19.1 MB...
Read more >
Apktool - How to Install - GitHub Pages
Try running apktool via command prompt. Linux: Download Linux wrapper script (Right click, Save Link As apktool ); Download apktool-2 (find newest here) ......
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