加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

ApkTool brut.common.BrutException: could not exec command解决方案

(2012-12-24 19:06:49)
标签:

杂谈

分类: android

F:\ApkTool>apktool  d z4root.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\doudouhe\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...

F:\ApkTool>apktool b z4root
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
F:\ApkTool\z4root\res\values\styles.xml:3: error: Error retrieving parent for item: No resource found that matches the given
name '@*android:style/Theme.Light'.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --mi
n-sdk-version, 4, -F, C:\Users\doudouhe\AppData\Local\Temp\APKTOOL5143956726492038165.tmp, -I, C:\Users\doudouhe\apktool\fram
ework\1.apk, -S, F:\ApkTool\z4root\res, -M, F:\ApkTool\z4root\AndroidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:255)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
        at brut.androlib.Androlib.buildResources(Androlib.java:269)
        at brut.androlib.Androlib.build(Androlib.java:192)
        at brut.androlib.Androlib.build(Androlib.java:174)
        at brut.apktool.Main.cmdBuild(Main.java:188)
        at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 4, -F, C:\Users\doudouhe\AppData\L
ocal\Temp\APKTOOL5143956726492038165.tmp, -I, C:\Users\doudouhe\apktool\framework\1.apk, -S, F:\ApkTool\z4root\res, -M, F:\Ap
kTool\z4root\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:83)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:253)
        ... 6 more

“brut.common.BrutException: could not exec command: [aapt, p, --mi
n-sdk-version, 4, -F,” I do not know what is the reason?

到底是什么问题呢?个人估计是版本问题,那么解决方案就是将android sdk下android-sdk-windows\platform-tools\aapt.exe复制并替换到apktool.jar相同目录下

还有一种做法,如果直接将F:\android-sdk-windows\platform-tools配置为环境变量,删除掉原目录下aapt.exe,直接运行。

0

阅读 收藏 喜欢 打印举报/Report
后一篇:关于SMALI语法
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有