Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TomorrowX opened this issue Feb 8, 2017 · 5 comments

Comments

@TomorrowX
Copy link

TomorrowX commented Feb 8, 2017

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
@TomorrowX
Copy link
Author

sorry for the mistake

@TomorrowX TomorrowX reopened this Feb 8, 2017
@TomorrowX
Copy link
Author

new file link
file:app-debug.apk
https://pan.cloudhua.com/s/4ei9W1XBR7M

@TomorrowX
Copy link
Author

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

@iBotPeaches
Copy link
Owner

➜  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.

@TomorrowX
Copy link
Author

Thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants