Apktool: Failed to build (v2.3.1) Caused by: brut.common.BrutException: could not exec (exit code = 1)

Created on 25 Feb 2018  路  4Comments  路  Source: iBotPeaches/Apktool

Information

  1. Apktool Version (apktool -version) -2.3.1
  2. Operating System (Mac, Linux, Windows) -Mac
  3. APK From? (Playstore, ROM, Other) -Playstore

Stacktrace/Logcat

I: Using Apktool 2.3.1
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: /Users/alex/work/project/reserv/cmusic/play/res/layout/a.xml:2: error: Error: No resource found that matches the given name (at 'style' with value '@style/RtlOverlay.Widget.AppCompat.ActionBar.TitleItem').
W:
W: /Users/alex/work/project/reserv/cmusic/play/res/layout/a0.xml:5: error: No resource identifier found for attribute 'placeholderImage' in package 'com.netease.cloudmusic'
W:
W: /Users/alex/work/project/reserv/cmusic/play/res/layout/a0.xml:7: error: Error: No resource found that matches the given name (at 'style' with value '@style/aboutContainer').
W:
W: /Users/alex/work/project/reserv/cmusic/play/res/layout/a0.xml:12: error: Error: No resource found that matches the given name (at 'style' with value '@style/aboutContainer_nobg').
W:
W: /Users/alex/work/project/reserv/cmusic/play/res/layout/a2.xml:4: error: No resource identifier found for attribute 'needApplyDrawableColor' in package 'com.netease.cloudmusic'
.
.
.
W: /Users/alex/work/project/reserv/cmusic/play/res/menu/b.xml:4: error: No resource identifier found for attribute 'showAsAction' in package 'com.netease.cloudmusic'
W:
W: /Users/alex/work/project/reserv/cmusic/play/res/menu/c.xml:4: error: No resource identifier found for attribute 'showAsAction' in package 'com.netease.cloudmusic'
W:
W: /Users/alex/work/project/reserv/cmusic/play/res/menu/d.xml:4: error: No resource identifier found for attribute 'showAsAction' in package 'com.netease.cloudmusic'
W:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/gb/yvd95yj94gd55qm12rmdjk_40000gn/T/brut_util_Jar_5277344822008311287.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 22, --version-code, 96, --version-name, 4.1.1, --no-version-vectors, -F, /var/folders/gb/yvd95yj94gd55qm12rmdjk_40000gn/T/APKTOOL5244176181589430502.tmp, -0, m4r, -0, db, -0, arsc, -I, /Users/alex/Library/apktool/framework/1.apk, -S, /Users/alex/work/project/reserv/cmusic/play/res, -M, /Users/alex/work/project/reserv/cmusic/play/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): [/var/folders/gb/yvd95yj94gd55qm12rmdjk_40000gn/T/brut_util_Jar_5277344822008311287.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 22, --version-code, 96, --version-name, 4.1.1, --no-version-vectors, -F, /var/folders/gb/yvd95yj94gd55qm12rmdjk_40000gn/T/APKTOOL5244176181589430502.tmp, -0, m4r, -0, db, -0, arsc, -I, /Users/alex/Library/apktool/framework/1.apk, -S, /Users/alex/work/project/reserv/cmusic/play/res, -M, /Users/alex/work/project/reserv/cmusic/play/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): [/var/folders/gb/yvd95yj94gd55qm12rmdjk_40000gn/T/brut_util_Jar_5277344822008311287.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 22, --version-code, 96, --version-name, 4.1.1, --no-version-vectors, -F, /var/folders/gb/yvd95yj94gd55qm12rmdjk_40000gn/T/APKTOOL5244176181589430502.tmp, -0, m4r, -0, db, -0, arsc, -I, /Users/alex/Library/apktool/framework/1.apk, -S, /Users/alex/work/project/reserv/cmusic/play/res, -M, /Users/alex/work/project/reserv/cmusic/play/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:95)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:450)
    ... 6 more

Steps to Reproduce

  1. apktool d com.netease.cloudmusic.apk -out play
  2. apktool b play

Frameworks

Not from OEM ROOM

APK

https://play.google.com/store/apps/details?id=com.netease.cloudmusic&hl=en

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

Other infomation

  1. aapt has been set in $PATH to /Users/alex/Library/Android/sdk/build-tools/27.0.3/
  2. apktool empty-framework-dir --force has tried still not working
  3. apktool d --no-res and then apktool b works. after that, resign and install it can not run
    Stacktrace/Logcat:
02-25 08:36:10.764 1218-1240/? W/WindowManager: Token{8b33f18 ActivityRecord{e7292fb u0 com.netease.cloudmusic/.activity.LoadingActivity t7287}} failed creating starting window
                                                android.content.res.Resources$NotFoundException: Drawable com.netease.cloudmusic:drawable/p_login_bg with resource ID #0x7f020498
                                                Caused by: android.content.res.Resources$NotFoundException: File r/b/p_login_bg.png from drawable resource ID #0x7f020498  
Bug

Most helpful comment

Looks like AndroResGuard or some hybrid of it. Have some other issues to look into that may fix this, then will loop back to it.

All 4 comments

Looks like AndroResGuard or some hybrid of it. Have some other issues to look into that may fix this, then will loop back to it.

I have the same issue, really need a fix. I use v2.3.2

Me too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harshkuttu picture harshkuttu  路  3Comments

dotjaz picture dotjaz  路  4Comments

trandua picture trandua  路  3Comments

alexeikh picture alexeikh  路  3Comments

LeeDroid- picture LeeDroid-  路  3Comments