'Unsigned short value out of range' despite multidex smali_redist flags

Mobile Testing, Android App Testing.
mkoszyka
Posts: 1
Joined: Mon Dec 14, 2020 2:04 pm

'Unsigned short value out of range' despite multidex smali_redist flags

Post by mkoszyka » Mon Dec 14, 2020 3:22 pm

Hello everyone!


I decided to post my Android instrumentation problem here as maybe someone could had similar error?


I know that usually this should be corrected by instrumentation flags: -multidex -smali_redist.
But I use them ('-static -multidex -smali_redist' exactly) always and this time they don't help.

This time our mobile app vendor released a new version with some PDF libraries added and instrumentation stopped working
(the app grown about 65% in size - from around 28 to 46 MB).


System.InvalidOperationException: Failed to recompile the instrumented code. See details for more information: Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Lcom/google/android/gms/internal/clearcut/zzfx;->zzeq()Lcom/google/android/gms/internal/clearcut/zzfx;
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1046)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:345)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:300)
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:420)
at brut.androlib.Androlib.buildNonDefaultSources(Androlib.java:366)
at brut.androlib.Androlib.build(Androlib.java:304)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.apktool.Main.cmdBuild(Main.java:259)
at brut.apktool.Main.main(Main.java:85)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x69
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1319)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:1042)
... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65543
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:1279)
... 11 more