Apktool: Failed at Building resources

Created on 22 Jul 2018  路  3Comments  路  Source: iBotPeaches/Apktool

Information

  1. Apktool Version 2.3.0 -
  2. Operating System Android(Using Termux App) -
  3. APK From? System -

Stacktrace/Logcat

Exception in thread "main" brut.androlib.AndrolibException: java.io.IOException: No such file or directory
        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: java.io.IOException: No such file or directory
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createTempFile(File.java:2024)
        at java.io.File.createTempFile(File.java:2070)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:464)
        ... 5 more

Steps to Reproduce

  1. pwd
Output:
/storage/extSdCard/Rafi/Editing/SystemUI
  1. apktool d -p $HOME/apktool/framework -o SystemUI_src SystemUI.apk
rafinetiz # apktool d -p $HOME/apktool/framework -f -o SystemUI_src SystemUI.apk
I: Using Apktool 2.3.0 on SystemUI.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /data/data/com.termux/files/home/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
  1. apktool b -p $HOME/apktool/framework -o SystemUI_src.apk SystemUI_src
rafinetiz # apktool b -p $HOME/apktool/framework -o SystemUI_src.apk SystemUI_src
I: Using Apktool 2.3.0
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: java.io.IOException: No such file or directory
        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: java.io.IOException: No such file or directory
        at java.io.UnixFileSystem.createFileExclusively(Native Method)
        at java.io.File.createTempFile(File.java:2024)
        at java.io.File.createTempFile(File.java:2070)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:464)
        ... 5 more
  1. ls SystemUI_src
rafinetiz # ls SystemUI_src
total 288
-rwxrwx---    1 root     sdcard_r   38.6K Jul 23 02:36 AndroidManifest.xml
-rwxrwx---    1 root     sdcard_r   38.6K Jul 23 02:36 AndroidManifest.xml.orig
-rwxrwx---    1 root     sdcard_r     534 Jul 23 02:37 apktool.yml
drwxrwx---    3 root     sdcard_r   32.0K Jul 23 02:38 build
drwxrwx---    3 root     sdcard_r   32.0K Jul 23 02:37 original
drwxrwx---  310 root     sdcard_r   32.0K Jul 23 02:37 res
drwxrwx---    3 root     sdcard_r   32.0K Jul 23 02:37 unknown

I tried rebuilding my SystemUI without changing anything in resources.
I am so confused, it say Caused by: java.io.IOException: No such file or directory
But which file is missing?

Questions to ask before submission

  1. Are you using the latest apktool version? Yes, i tried using latest version of apktool but it still give a error

Most helpful comment

Thanks for the reply,
Is true, Apktool build will create a temporary directory at /tmp that not available in android by the default.
So i try create /tmp directory manually, and now it works.

Maybe on next update you can add a ability to change temp directory location.
and sorry if my grammar its too bad for you xD.

Bro I have the same problem, can you tell me how you solved it

All 3 comments

Apktool doesn't officially support running on Android yet. It looks like you cannot create a temporary file (which is needed in a few places) during the build process.

Sorry, maybe some day running Apktool on Android will be official and supported.

Thanks for the reply,
Is true, Apktool build will create a temporary directory at /tmp that not available in android by the default.
So i try create /tmp directory manually, and now it works.

Maybe on next update you can add a ability to change temp directory location.
and sorry if my grammar its too bad for you xD.

Thanks for the reply,
Is true, Apktool build will create a temporary directory at /tmp that not available in android by the default.
So i try create /tmp directory manually, and now it works.

Maybe on next update you can add a ability to change temp directory location.
and sorry if my grammar its too bad for you xD.

Bro I have the same problem, can you tell me how you solved it

Was this page helpful?
0 / 5 - 0 ratings