Apktool: Error While rebuilding Whatsapp.apk

Created on 4 Nov 2017  Â·  6Comments  Â·  Source: iBotPeaches/Apktool

Information

  1. Apktool Version (apktool -version) - 2.3.0-dirty
  2. Operating System (Mac, Linux, Windows) - Kali Linux
  3. APK From? (Playstore, ROM, Other) - androidapksfree.com

Stacktrace/Logcat

I: Using Apktool 2.3.0-dirty
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /root/Desktop/wp/res/layout-v22/abc_alert_dialog_button_bar_material.xml:2: error: No resource identifier found for attribute 'scrollIndicators' in package 'android'
W: 
W: /root/Desktop/wp/res/layout-v26/abc_screen_toolbar.xml:5: error: No resource identifier found for attribute 'keyboardNavigationCluster' in package 'android'
W: 
W: /root/Desktop/wp/res/layout-v22/status_playback_text.xml:4: error: No resource identifier found for attribute 'breakStrategy' in package 'android'
W: 
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/usr/bin/aapt, p, --min-sdk-version, 15, --target-sdk-version, 25, --version-code, 452065, --version-name, 2.17.395, --no-version-vectors, -F, /tmp/APKTOOL3626292701603724599.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /root/Desktop/wp/res, -M, /root/Desktop/wp/AndroidManifest.xml]
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:485)
    at brut.androlib.Androlib.buildResources(Androlib.java:419)
    at brut.androlib.Androlib.build(Androlib.java:318)
    at brut.androlib.Androlib.build(Androlib.java:270)
    at brut.apktool.Main.cmdBuild(Main.java:224)
    at brut.apktool.Main.main(Main.java:75)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/usr/bin/aapt, p, --min-sdk-version, 15, --target-sdk-version, 25, --version-code, 452065, --version-name, 2.17.395, --no-version-vectors, -F, /tmp/APKTOOL3626292701603724599.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /root/Desktop/wp/res, -M, /root/Desktop/wp/AndroidManifest.xml]
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:454)
    at brut.androlib.Androlib.buildResourcesFull(Androlib.java:471)
    ... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/usr/bin/aapt, p, --min-sdk-version, 15, --target-sdk-version, 25, --version-code, 452065, --version-name, 2.17.395, --no-version-vectors, -F, /tmp/APKTOOL3626292701603724599.tmp, -0, arsc, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /root/Desktop/wp/res, -M, /root/Desktop/wp/AndroidManifest.xml]
    at brut.util.OS.exec(OS.java:95)
    at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:448)
    ... 6 more

Steps to Reproduce

  1. apktool d Whatsapp.apk
  2. apktool b Whatsapp

Frameworks

default apktool framework-res

APK

https://www.androidapksfree.com/apk/whatsapp-apk-latest-version-download/

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

All 6 comments

today i just meet the issue.
And thanks to a guy's advice, i resolved it.

the root causes was the framework in apktool was out of date,and i didn't update.

SOLUTION :
delete the framework file,and apktool will update automate.
the file path :
C:\Users\xxx\apktool\framework\1.apk
OR
C:\Users\XXX\AppData\Local\apktool\framework\1.apk

After removing the framework apk, it works on my iMac. but your solution does not work on Linux.

I have kali linux

You can run

apktool empty-framework-dir --force

To accomplish the same thing.

Hi @RamiOssman,

Did you manage to get the app signed and running?

Thanks
Avi

➜  1655 apktool d whatsapp.apk 
I: Using Apktool 2.3.1-ef9be8-SNAPSHOT on whatsapp.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...
➜  1655 apktool b whatsapp
I: Using Apktool 2.3.1-ef9be8-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
➜  1655 

I could not replicate this. Follow the above instructions & comments if you are having troubles. Closing as I cannot replicate.

apktool wont rebuild... any suggestions?

Was this page helpful?
0 / 5 - 0 ratings