Apktool: Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc toryException: file must be a directory

Created on 18 Mar 2015  路  18Comments  路  Source: iBotPeaches/Apktool

Original issue 709 created by nabeelshikder on 2014-11-25T05:13:54.000Z:

What steps will reproduce the problem?

  1. apktool decode C:\Users\user\Desktop\com.sgiggle.production.apk

What is the expected output? What do you see instead?

Expected: decode without errors

Result:

C:\Windows>apktool decode C:\Users\user\Desktop\com.sgiggle.production.apk
I: Using Apktool 2.0.0-RC2 on com.sgiggle.production.apk
I: Loading resource table...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: file must be a directory: com.sgiggle.production
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:313
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:123)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
at brut.apktool.Main.cmdDecode(Main.java:170)
at brut.apktool.Main.main(Main.java:86)
Caused by: brut.directory.DirectoryException: file must be a directory: com.sgig
gle.production
at brut.directory.FileDirectory.<init>(FileDirectory.java:38)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:291
)
... 4 more

C:\Windows>apktool decode C:\Windows\com.sgiggle.production.apk
I: Using Apktool 2.0.0-RC2 on com.sgiggle.production.apk
I: Loading resource table...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.Direc
toryException: file must be a directory: com.sgiggle.production
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:313
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:123)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
at brut.apktool.Main.cmdDecode(Main.java:170)
at brut.apktool.Main.main(Main.java:86)
Caused by: brut.directory.DirectoryException: file must be a directory: com.sgig
gle.production
at brut.directory.FileDirectory.<init>(FileDirectory.java:38)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:291
)
... 4 more

What version of the product are you using? On what operating system?
Version 2.0.0 RC2
Windows 8 64-Bit

Please provide any additional information below.

The apk file is over 20MB so it is too large to attach to this Email. However, it can be downloaded from here: http://apk-dl.com/download/android/com.sgiggle.production/Tango-Messenger%2C-Video-%26-Calls3.12.119443-apk/

(Tango Messenger App)

Please let me know how to resolve this error.

Most helpful comment

In fact,i runing on windows 10,use administor run the cmd will be ok

All 18 comments

Comment #1 originally posted by nabeelshikder on 2014-11-26T01:56:08.000Z:

Can anyone else confirm that this issue is reproducible?

Comment #2 originally posted by JaVallet on 2014-11-26T17:13:57.000Z:

Unpacked fine for me, even using apktool 2.0.0-b9 (OS Ubuntu 14.04 LTS). Output suggests the decode directory doesn't exist - maybe a permissions error? Try running from a different directory, or trying running cmd as admin or something like that.

Comment #3 originally posted by connor.tumbleson on 2014-11-26T17:25:36.000Z:

Not a bug. Could not duplicate.

Comment # 2 are good suggestions to try. The folder used for dumping the apk could be created/read/used.

first I execute the command 'java -jar apktool.jar d example.apk' as root, it occurs this bug.when i execute the command as myself , it successes.

@dunyuling using root means, frameworks are probably being written in a location which cannot be read. My suggestion is don't use root. That's dangerous and apktool doesn't need it.

I had this problem and adding sudo to the beginning of the command solved it

Facing the Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: for some apk like whatsapp. I'm using windows

Do you know any solution?

You'll have better luck opening a bug report following all the details as a DirectoryException can be easy as running the command wrong or a bug.

As i mentioned this happens for some apps. Same commands work for my own apk. I doubt that apktool doesn't work with obfuscation / progaurd thing!

In fact,i runing on windows 10,use administor run the cmd will be ok

change to administrator solved the problems in cmd

Hey, I am getting the following:
C:\Windows>apktool d test.apk
I: Using Apktool 2.3.3 on test.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
S: WARNING: Could not write to (C:\Users\Dell\AppData\Local\apktool\framewo
rk), using C:\Users\DELL1\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing,
please utilize --frame-path if the default storage directory is unavailable
I: Loading resource table from file: C:\Users\DELL1\AppData\Local\Temp\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...

I am not sure what this means? It added an APK file in temp but where are the decoded files?

Running it as sudo/root on Linux resolved my problem

I had this problem and adding sudo to the beginning of the command solved it

Thanks , it's working for me

I am facing the same Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: and i did anything i could do but all in vain. Anyone got any solution?

I had this problem and adding sudo to the beginning of the command solved it

for windows run cmd as administrator

Exception in thread "main" brut.androlib.AndrolibException: Can't create directory: /home/kumar_pc/.local/share/apktool/framework

help me in this

I had the exact same issue. I had to run command prompt as administrator. Hopefully this helps.

Was this page helpful?
0 / 5 - 0 ratings