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.

Exception in thread "main" brut.androlib.AndrolibException: Multiple resources

See original GitHub issue

Hi, I seem to have this exception come up with this particular APK: Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f090000 string/APKTOOL_DUMMYVAL_0x7f090000, config=-sr Other APKs decode as expected. I apologise if this comes under an existing issue!

Information

  1. Apktool Version (apktool -version) - 2.2.1
  2. Operating System (Mac, Linux, Windows) - Windows 10
  3. APK From? (Playstore, ROM, Other) - Pulled from the device (Nexus 6P, Android Nougat)

Stacktrace/Logcat

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

C:\WINDOWS\system32>apktool -version
2.2.1

C:\WINDOWS\system32>cd C:\Users\admin\Downloads

C:\Users\admin\Downloads>apktool d base.apk
I: Using Apktool 2.2.1 on base.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f090000 string/APKTOOL_DUMMYVAL_0x7f090000, config=-sr
        at brut.androlib.res.data.ResType.addResource(ResType.java:66)
        at brut.androlib.res.data.ResType.addResource(ResType.java:55)
        at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:270)
        at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:226)
        at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:156)
        at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:118)
        at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:80)
        at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
        at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:558)
        at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:72)
        at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:64)
        at brut.androlib.Androlib.getResTable(Androlib.java:68)
        at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:193)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
        at brut.apktool.Main.cmdDecode(Main.java:166)
        at brut.apktool.Main.main(Main.java:81)

C:\Users\admin\Downloads>aapt d configurations base.apk

nodpi-v4
v12
v21
v23
ldpi-v4
mdpi-v4
ldrtl-mdpi-v17
tvdpi-v4
hdpi-v4
ldrtl-hdpi-v17
xhdpi-v4
ldrtl-xhdpi-v17
xxhdpi-v4
ldrtl-xxhdpi-v17
xxxhdpi-v4
ldrtl-xxxhdpi-v17
sw600dp-v13
v17
fr
es
it
pt
ca
da
fa
ja
ka
pa
ta
nb
be
de
he
ne
te
af
bg
th
fi
hi
si
vi
kk
mk
sk
uk
el
gl
ml
nl
pl
sl
tl
am
km
bn
in
kn
mn
ko
lo
ro
sq
ar
hr
mr
sr
tr
ur
bs
cs
is
ms
et
lt
eu
gu
hu
ru
zu
lv
sv
iw
sw
hy
ky
my
az
uz
bs-rBA
fr-rCA
lo-rLA
en-rGB
bn-rBD
et-rEE
ka-rGE
ky-rKG
km-rKH
zh-rHK
si-rLK
mk-rMK
ur-rPK
sq-rAL
hy-rAM
my-rMM
zh-rCN
pa-rIN
ta-rIN
te-rIN
ml-rIN
en-rIN
kn-rIN
mr-rIN
gu-rIN
mn-rMN
ne-rNP
pt-rBR
gl-rES
eu-rES
is-rIS
es-rUS
it-rIT
pt-rPT
en-rAU
zh-rTW
be-rBY
ms-rMY
az-rAZ
kk-rKZ
uz-rUZ
large-v4
xlarge-v4
h720dp-v13
sw720dp-v13
sw800dp-v13
v18
land
night-v8
v11
v14
ldltr-v21
v22
v13
port

Steps to Reproduce

  1. apktool d base.apk

Frameworks

https://drive.google.com/open?id=0B3hypEmeC-VnMHhxSXlNaW9aa28

APK

https://drive.google.com/open?id=0B3hypEmeC-VnNDdwTFBBQ2hkd2c (From the Play Store)

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? N/A
  3. Are you using the latest apktool version? Yes

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Strandkrypacommented, Jan 10, 2017

Hello, thank you for the reply.

I tried --skip-broken-res but it didn’t seem to do anything. I used the --keep-broken-res in your example and got the following:

C:\Users\admin\Downloads>apktool d base.apk --keep-broken-res -f
I: Using Apktool 2.2.1 on base.apk
I: Loading resource table...
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090000
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090001
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090002
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090003
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090004
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090005
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090006
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090007
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090008
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090009
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f09000a
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f09000b
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f09000c
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f09000d
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f09000e
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f09000f
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090010
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090011
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090012
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090036
W: Duplicate Resource Detected. Ignoring duplicate: string-sr/APKTOOL_DUMMYVAL_0x7f090037
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\admin\AppData\Local\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: Error copying file: ?.xml
        at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:218)
        at brut.androlib.ApkDecoder.decode(ApkDecoder.java:158)
        at brut.apktool.Main.cmdDecode(Main.java:166)
        at brut.apktool.Main.main(Main.java:81)
Caused by: brut.directory.DirectoryException: Error copying file: ?.xml
        at brut.directory.DirUtil.copyToDir(DirUtil.java:88)
        at brut.directory.AbstractDirectory.copyToDir(AbstractDirectory.java:207)
        at brut.androlib.Androlib.decodeUnknownFiles(Androlib.java:211)
        ... 3 more
Caused by: java.io.FileNotFoundException: base\unknown\?.xml (The filename, directory name, or volume label syntax is incorrect)
        at java.io.FileOutputStream.open0(Native Method)
        at java.io.FileOutputStream.open(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at brut.directory.DirUtil.copyToDir(DirUtil.java:84)
        ... 5 more

I tried it on a Mac system and did not come across this exception - is this Windows unable to handle the filenames?

0reactions
ouihamdaouicommented, Jan 12, 2018

Log For : app.apk

Log Type : Recompiling

Log Recorded At : 12 2018-01- 2:22:58,11

Log Recorded By : Advanced ApkTool v4.2.0 By BDFreak


W: C:\Users\pc\Desktop\AdvancedApkTool\3-Out\app.apk\AndroidManifest.xml:16: error: No resource identifier found for attribute ‘roundIcon’ in package ‘android’ W: Exception in thread “main” brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\pc\AppData\Local\Temp\brut_util_Jar_1479779000625798190.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 26, --version-code, 10, --version-name, 10.0, --no-version-vectors, -F, C:\Users\pc\AppData\Local\Temp\APKTOOL5360200212280990529.tmp, -0, arsc, -0, arsc, -I, C:\Users\pc\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\pc\Desktop\AdvancedApkTool\3-Out\app.apk\res, -M, C:\Users\pc\Desktop\AdvancedApkTool\3-Out\app.apk\AndroidManifest.xml] at brut.androlib.Androlib.buildResourcesFull(Androlib.java:492) at brut.androlib.Androlib.buildResources(Androlib.java:426) at brut.androlib.Androlib.build(Androlib.java:305) at brut.androlib.Androlib.build(Androlib.java:270) at brut.apktool.Main.cmdBuild(Main.java:227) at brut.apktool.Main.main(Main.java:75) Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\pc\AppData\Local\Temp\brut_util_Jar_1479779000625798190.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 26, --version-code, 10, --version-name, 10.0, --no-version-vectors, -F, C:\Users\pc\AppData\Local\Temp\APKTOOL5360200212280990529.tmp, -0, arsc, -0, arsc, -I, C:\Users\pc\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\pc\Desktop\AdvancedApkTool\3-Out\app.apk\res, -M, C:\Users\pc\Desktop\AdvancedApkTool\3-Out\app.apk\AndroidManifest.xml] at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:456) at brut.androlib.Androlib.buildResourcesFull(Androlib.java:478) … 5 more Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\pc\AppData\Local\Temp\brut_util_Jar_1479779000625798190.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 26, --version-code, 10, --version-name, 10.0, --no-version-vectors, -F, C:\Users\pc\AppData\Local\Temp\APKTOOL5360200212280990529.tmp, -0, arsc, -0, arsc, -I, C:\Users\pc\Desktop\AdvancedApkTool\1-BDFreak\Frameworks\1.apk, -S, C:\Users\pc\Desktop\AdvancedApkTool\3-Out\app.apk\res, -M, C:\Users\pc\Desktop\AdvancedApkTool\3-Out\app.apk\AndroidManifest.xml] at brut.util.OS.exec(OS.java:95) at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:450) … 6 more

Read more comments on GitHub >

github_iconTop Results From Across the Web

decompile framework-res.apk multiple resources exception
apktool if framework-res.apk. I'm getting the following log: Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x01080293 ...
Read more >
brut.directory.directoryexception: java.util.zip.zipexception: zip ...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.util.zip.ZipException: zip END header not found #2324 ...
Read more >
[UTIL][NOV 24, 2022] Apktool - Tool for reverse engineering ...
Exception in thread "main" brut.androlib.AndrolibException: Arsc files with zero or multiple packages at brut.androlib.res.
Read more >
Cannot open app from local APK file - Katalon Studio
... Exception in thread “main” brut.androlib.AndrolibException: Multiple resources: spec=0x7f080019 drawable/abc_dialog_material_background, ...
Read more >
Unable to lunch the app on emulator API 30 - Appium Discuss
... exited with code 1; StdErr: Exception in thread “main” brut.androlib.AndrolibException: Multiple resources: spec=0x7f0800cb ...
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