On our latest release we are unable to instrument the apk, we get the following error:
We are using the following:System.Exception: 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 Landroid/support/v4/util/LongSparseArray;->clone()Landroid/support/v4/util/LongSparseArray;
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:824)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:267)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:245)
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:423)
at brut.androlib.Androlib.buildNonDefaultSources(Androlib.java:369)
at brut.androlib.Androlib.build(Androlib.java:311)
at brut.androlib.Androlib.build(Androlib.java:267)
at brut.apktool.Main.cmdBuild(Main.java:230)
at brut.apktool.Main.main(Main.java:83)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x15
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1091)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:820)
... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65553
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:348)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1051)
... 11 more
at Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.CompileApkFile(String sourceApkFilePath, IPathService pathService)
at Ranorex.Plugin.Mobile.Utils.BackgroundWorkerSupported.ExecuteBgwCode[TArg0,TArg1](BgwDelegate`2 methodDelegate, Int32 doneProgress, String progressText, TArg0 arg0, TArg1 arg1, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.Instrument(String apkFilePath, Int32 port, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)
Ranorex 8.0.1
apktook - 2.3.1
unobfuscated apk
We've usually instrument using the -static -multidex flags, but that doesn't work this time.
Any help would be very much appreciated.