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.

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

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
iBotPeachescommented, Feb 8, 2017
➜  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.

0reactions
TomorrowXcommented, Feb 9, 2017

Thanks a lot 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

brut.androlib.AndrolibException: brut.common.BrutException ...
Main.main(Main.java:84) Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): ...
Read more >
How Fix brut.androlib.AndrolibException: brut.common ...
Because apktool uses aapt internally to package the apk, if the content is incompatible with aapt then apktool will raise the error.
Read more >
iBotPeaches/Apktool - Gitter
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): ...
Read more >
Apktool – build error – brut.common.BrutException: could not ...
BrutException : could not exec (exit code = 1). 2 Replies ... Exception in thread "main" brut.androlib. ... AndrolibException: brut.common.
Read more >
Tool for reverse engineering apk files | Page 264 - XDA Forums
Androlib.build(Androlib.java:270) at brut.apktool.Main. ... AndrolibException: brut.common.BrutException: could not exec (exit code = 1): ...
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