sky201503 / android-apktool-1

Automatically exported from code.google.com/p/android-apktool
0 stars 0 forks source link

Smali error message doesn't say what file or what the problem is #299

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I made some changes to smali code and then rebuild with apktool 1.4.3.  This is 
the exception I get which doesn't include the file name or what the problem is. 
 It takes a lot of effort to try to work out the actual problem.

I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali 
file: java.io.FileInputStream@1b5ae101
    at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
    at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
    at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)
    at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)
    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)

Original issue reported on code.google.com by rogerbinns on 3 Feb 2012 at 5:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I should note that when using the smali tool separately it did tell me exactly 
which file, line and cause was.

Original comment by rogerbinns on 23 Feb 2012 at 7:07

GoogleCodeExporter commented 9 years ago
please explain how this issue was solved?

Original comment by pruthvib...@gmail.com on 25 Sep 2012 at 12:24

GoogleCodeExporter commented 9 years ago
I also used smali to find the problem. Get smali from code.google.com/p/smali/

Then run smali on the directory with the code you need to rebuild as follows:

java -Xmx512m -jar smali-<VERSION>.jar -o someOutputFile.dex 
c:\path\to\code\folder

Note that <VERSION> is whatever version of smali you have. Just use whatever 
the smali jar filename for this part.

The output file (-o option) is somewhat pointless if all you want is to have 
smali print what the problem is, but if it works it would be nice to know where 
your dex file will be

Original comment by nickwen...@gmail.com on 25 Oct 2012 at 10:23

GoogleCodeExporter commented 9 years ago
We can pipe smali output to the screen. I'll see about that.

Original comment by connor.tumbleson on 16 Nov 2012 at 11:53

GoogleCodeExporter commented 9 years ago

Original comment by connor.tumbleson on 16 Nov 2012 at 11:53

GoogleCodeExporter commented 9 years ago
Issue 384 has been merged into this issue.

Original comment by connor.tumbleson on 4 Jan 2013 at 5:15

GoogleCodeExporter commented 9 years ago
Now it'll tell you the file that the problem occurred on, but the problem is it 
only will show you that file. Then if you have another error. It'll show the 
next one on the next run, since it only processes a failure then dies out.

[7,16] mismatched input 'static' expecting COLON
Exception in thread "main" brut.androlib.AndrolibException: Could not smali 
file: 
/home/ibotpeaches/build/wip/rom_wip_aries/d_apks/Browser.apk/smali/com/android/b
rowser/Z.smali

Original comment by connor.tumbleson on 5 Jan 2013 at 2:50