Apktool: Building resources with error : Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1)

Created on 8 Feb 2017  Â·  5Comments  Â·  Source: iBotPeaches/Apktool

Information

  1. Apktool Version (2.2.2) -
  2. Operating System (Mac) -
  3. APK From? (Demo Project By Myself) -

Stacktrace/Logcat

scbdeMac-mini:apktool Tomorrow$ java -jar ./apktool.jar b app-debug
I: Using Apktool 2.2.2
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /Users/scb/Documents/code/test2/xiemingtian/android_auto/apktool/app-debug/res/values-v23/styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/AlertDialog'.
W: 
W: /Users/scb/Documents/code/test2/xiemingtian/android_auto/apktool/app-debug/res/values-v23/styles.xml:9: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/DialogWindowTitle'.
W: 
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/h8/fsdly03d4pnfx8vvj9l_8q940000gn/T/brut_util_Jar_7734224011012191879.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 25, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /var/folders/h8/fsdly03d4pnfx8vvj9l_8q940000gn/T/APKTOOL8087032693986459715.tmp, -0, arsc, -0, arsc, -I, /Users/scb/Library/apktool/framework/1.apk, -S, /Users/scb/Documents/code/test2/xiemingtian/android_auto/apktool/app-debug/res, -M, /Users/scb/Documents/code/test2/xiemingtian/android_auto/apktool/app-debug/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/h8/fsdly03d4pnfx8vvj9l_8q940000gn/T/brut_util_Jar_7734224011012191879.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 25, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /var/folders/h8/fsdly03d4pnfx8vvj9l_8q940000gn/T/APKTOOL8087032693986459715.tmp, -0, arsc, -0, arsc, -I, /Users/scb/Library/apktool/framework/1.apk, -S, /Users/scb/Documents/code/test2/xiemingtian/android_auto/apktool/app-debug/res, -M, /Users/scb/Documents/code/test2/xiemingtian/android_auto/apktool/app-debug/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/h8/fsdly03d4pnfx8vvj9l_8q940000gn/T/brut_util_Jar_7734224011012191879.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 25, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, /var/folders/h8/fsdly03d4pnfx8vvj9l_8q940000gn/T/APKTOOL8087032693986459715.tmp, -0, arsc, -0, arsc, -I, /Users/scb/Library/apktool/framework/1.apk, -S, /Users/scb/Documents/code/test2/xiemingtian/android_auto/apktool/app-debug/res, -M, /Users/scb/Documents/code/test2/xiemingtian/android_auto/apktool/app-debug/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:95)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:434)
    ... 6 more

Steps to Reproduce

  1. just use the android studio(v2.2.3) and create a new simple project without changing anything.
  2. info about project
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    minSdkVersion 16
    targetSdkVersion 25
    dependencies {
    compile fileTree(dir: 'libs', include: ['.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.0.1'
    testCompile 'junit:junit:4.12'
    }
    *NOTTHING ELSE

    3.java -jar ./apktool.jar b app-debug

Frameworks

No

APK

If this APK can be freely shared, please upload/attach a link to it.
file:app-debug.apk . https://pan.cloudhua.com/s/dvkqBk8xRxI 

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? YES
  2. Are you using the latest apktool version?YES v2.2.2

Most helpful comment

➜  Bug1425 apktool d app-debug.apk 
I: Using Apktool 2.2.2 on app-debug.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/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...
I: Copying original files...
➜  Bug1425 apktool b app-debug
I: Using Apktool 2.2.2
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
I: Copying unknown files/dir...
➜  Bug1425 

Seems you might have an outdated framework. Make sure to run apktool empty-framework-dir --force to refresh those.

All 5 comments

sorry for the mistake

i have tried it on windows 10 and it works fine, maybe it is OS problem?

➜  Bug1425 apktool d app-debug.apk 
I: Using Apktool 2.2.2 on app-debug.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/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...
I: Copying original files...
➜  Bug1425 apktool b app-debug
I: Using Apktool 2.2.2
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
I: Copying unknown files/dir...
➜  Bug1425 

Seems you might have an outdated framework. Make sure to run apktool empty-framework-dir --force to refresh those.

Thanks a lot :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ickacn picture ickacn  Â·  4Comments

rafinetiz picture rafinetiz  Â·  3Comments

eriklu picture eriklu  Â·  3Comments

LeeDroid- picture LeeDroid-  Â·  3Comments

trandua picture trandua  Â·  3Comments