Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

Error: Unable to rebuild apk with apktool

Open king-ckm007 opened this issue 7 years ago • 2 comments

Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Landroid/support/v4/util/LongSparseArray;->clone()Landroid/support/v4/util/LongSparseArray;
	at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:917)
	at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:341)
	at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:297)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
	at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
	at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:419)
	at brut.androlib.Androlib.buildSources(Androlib.java:350)
	at brut.androlib.Androlib.build(Androlib.java:302)
	at brut.androlib.Androlib.build(Androlib.java:269)
	at brut.apktool.Main.cmdBuild(Main.java:247)
	at brut.apktool.Main.main(Main.java:79)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x13
	at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1190)
	at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:913)
	... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65544
	at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
	at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:356)
	at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1150)
	... 11 more
Error: Unable to rebuild apk with apktool

king-ckm007 avatar Jul 08 '19 19:07 king-ckm007

You have too many methods. The max value of an unsigned short is 65,535. You have 65,544. This is not a bug.

iBotPeaches avatar Jul 12 '19 21:07 iBotPeaches

how to fix that too many method ,would you help

VENUROCKS avatar Sep 20 '19 04:09 VENUROCKS