FORUMS

APKTOOL - recompiling error

2,277 posts
Thanks Meter: 3,910
 
By MaxFTW, Senior Member on 26th October 2012, 05:38 PM
Post Reply Email Thread
I had been looking before for the same thread I created, but I hadn't found so I created this one. I want to mod some apps for my Jelly Sandwich. Decompiling goes well, but recompiling - error!

This what I exactly do:
  1. apktool if framework-res.apk (success)
  2. apktool d SystemUI.apk (success)
  3. apktool b SystemUI.apk (error)

This is what I get after recompiling command:

Code:
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not write dex
to file: SystemUI\build\apk\classes.dex
        at brut.androlib.src.DexFileBuilder.writeTo(DexFileBuilder.java:61)
        at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
        at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
        at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:222)
        at brut.androlib.Androlib.buildSources(Androlib.java:179)
        at brut.androlib.Androlib.build(Androlib.java:170)
        at brut.androlib.Androlib.build(Androlib.java:154)
        at brut.apktool.Main.cmdBuild(Main.java:182)
        at brut.apktool.Main.main(Main.java:67)
Caused by: java.io.FileNotFoundException: SystemUI\build\apk\classes.dex (Odmowa
 dostŕpu)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at brut.androlib.src.DexFileBuilder.writeTo(DexFileBuilder.java:57)
        ... 8 more

Even without changing anything, apktool doesn't recompile my apk.


I have tried to recompile on two PCs - both of them have latest Java software installed.

I could post it in General Android section, but I think it can be related with Xperia only.


-----------------EDIT------------------------

I got something like that once also:

Code:
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/drawab
le-sw600dp-hdpi
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/layout
-sw600dp
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/values
-sw600dp
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/values
-sw600dp-port
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/values
-sw720dp
invalid resource directory name: C:\Users\JA\Desktop\apktool\SystemUI\res/values
-sw720dp-port
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\JA\AppData\Local\Temp\APKT
OOL5816768975862364769.tmp, -I, C:\Users\JA\apktool\framework\1.apk, -S, C:\User
s\JA\Desktop\apktool\SystemUI\res, -M, C:\Users\JA\Desktop\apktool\SystemUI\Andr
oidManifest.xml]
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:193)
        at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
        at brut.androlib.Androlib.buildResources(Androlib.java:248)
        at brut.androlib.Androlib.build(Androlib.java:171)
        at brut.androlib.Androlib.build(Androlib.java:154)
        at brut.apktool.Main.cmdBuild(Main.java:182)
        at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U
sers\JA\AppData\Local\Temp\APKTOOL5816768975862364769.tmp, -I, C:\Users\JA\apkto
ol\framework\1.apk, -S, C:\Users\JA\Desktop\apktool\SystemUI\res, -M, C:\Users\J
A\Desktop\apktool\SystemUI\AndroidManifest.xml]
        at brut.util.OS.exec(OS.java:83)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:191)
        ... 6 more
The Following User Says Thank You to MaxFTW For This Useful Post: [ View ] Gift MaxFTW Ad-Free
26th October 2012, 06:11 PM |#2  
zhanjia's Avatar
Senior Member
Flag Penang
Thanks Meter: 1,227
 
Donate to Me
More
I had this problem before too
Are you sure the apk you decompiled hasnt been modified my anyone before ?

Are you using the latest aapt and apktool ? Apktool 1.5 kinda fix all those problems, althought most problems come from apk..

In the second log of your apktool, all you need to do is edit the xml files where the error is coming from.

Anyway, heres the apktool thread
http://forum.xda-developers.com/show....php?t=1755243


Sent from my WT19i
The Following User Says Thank You to zhanjia For This Useful Post: [ View ] Gift zhanjia Ad-Free
26th October 2012, 06:45 PM |#3  
Quote:
Originally Posted by kokzhanjia

I had this problem before too
Are you sure the apk you decompiled hasnt been modified my anyone before ?

Are you using the latest aapt and apktool ? Apktool 1.5 kinda fix all those problems, althought most problems come from apk..

In the second log of your apktool, all you need to do is edit the xml files where the error is coming from.

Anyway, heres the apktool thread
http://forum.xda-developers.com/show....php?t=1755243


Sent from my WT19i

This 1.5 is strange... What is the comand for decompiling, compilng and installing frameworks? Damn...

Sent from my HTC One X using xda premium
26th October 2012, 06:48 PM |#4  
zhanjia's Avatar
Senior Member
Flag Penang
Thanks Meter: 1,227
 
Donate to Me
More
Install frameworks first :apktool if framework-res.apk

Decompile : apktool d <name of apk> <folder created>

Recompile : apktool b <name of folder> <name of new apk>

Sent from my WT19i
The Following User Says Thank You to zhanjia For This Useful Post: [ View ] Gift zhanjia Ad-Free
26th October 2012, 10:26 PM |#5  
Well, those methods work on 1.4.3 downloaded from Google project site only. And recompiling doesn't work also.

So I cannot recompile modded before apks by other people?

Sent from the best phone in the world - HTC One X with ARHD and Bricked Kernel 1,6 GHz
27th October 2012, 01:53 AM |#6  
zhanjia's Avatar
Senior Member
Flag Penang
Thanks Meter: 1,227
 
Donate to Me
More
Quote:
Originally Posted by maxio1998

Well, those methods work on 1.4.3 downloaded from Google project site only. And recompiling doesn't work also.

So I cannot recompile modded before apks by other people?

Sent from the best phone in the world - HTC One X with ARHD and Bricked Kernel 1,6 GHz

You can,but thr error you stated may happen again,maybe if you could send that apk and i have a look ? If its okay to you

Sent from my WT19i
The Following User Says Thank You to zhanjia For This Useful Post: [ View ] Gift zhanjia Ad-Free
27th October 2012, 10:34 AM |#7  
jader13254's Avatar
Senior Member
Flag Hamburg
Thanks Meter: 18,025
 
Donate to Me
More
I would learn to use apktool before making a ROM

Well, I had this problem a few month ago, and i solved it by reinstalling / downloading it and putting stock. 587 framework-res.apk...

Try it, hope it helps

Sent from my LT18i using xda app-developers app
The Following User Says Thank You to jader13254 For This Useful Post: [ View ] Gift jader13254 Ad-Free
28th October 2012, 08:41 AM |#8  
Quote:
Originally Posted by jader13254

I would learn to use apktool before making a ROM

Well, I had this problem a few month ago, and i solved it by reinstalling / downloading it and putting stock. 587 framework-res.apk...

Try it, hope it helps

Sent from my LT18i using xda app-developers app

I just cannot solve it, I installed 587 framework and infact I cannot recompile anything
28th October 2012, 11:02 AM |#9  
papayayoghurt's Avatar
Senior Member
Flag Vienna
Thanks Meter: 666
 
More
Try
Put an Folder where is just apktool.jar and aapt.exe
Open command
Type java -jar apktool.jar if framework-res.apk
Then type java -jar apktool.jar if SemcGenericUxpRes.apk
Then type java -jar apktool.jar d SystemUI.apk
Then java -jar apktool.jar b SystemUI

Gesendet von meinem LT18i mit Tapatalk 2
The Following User Says Thank You to papayayoghurt For This Useful Post: [ View ] Gift papayayoghurt Ad-Free
28th October 2012, 03:31 PM |#10  
Quote:
Originally Posted by papayayoghurt

Try
Put an Folder where is just apktool.jar and aapt.exe
Open command
Type java -jar apktool.jar if framework-res.apk
Then type java -jar apktool.jar if SemcGenericUxpRes.apk
Then type java -jar apktool.jar d SystemUI.apk
Then java -jar apktool.jar b SystemUI

Gesendet von meinem LT18i mit Tapatalk 2

Danke schön! I will try later, Freund!

Sent from the best phone in the world - HTC One X with ARHD and Bricked Kernel 1,6 GHz
28th October 2012, 04:58 PM |#11  
jader13254's Avatar
Senior Member
Flag Hamburg
Thanks Meter: 18,025
 
Donate to Me
More
Quote:
Originally Posted by maxio1998

Danke schön! I will try later, Freund!

Sent from the best phone in the world - HTC One X with ARHD and Bricked Kernel 1,6 GHz

Danke schön, ich werde es später probieren mein Freund

Sent from my LT18i using xda app-developers app
Post Reply Subscribe to Thread

Tags
apks, apktool, mod, recompile

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes