Page 1 of 1

Error while deploying apk file

Posted: Mon Dec 03, 2018 5:55 am
by Punashri M S
Hello All,

Am facing a issue while deploying the apk file.

Find the attached file for error message.
Error.png
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 Lcom/google/android/gms/internal/clearcut/zzfx;->zzeq()Lcom/google/android/gms/internal/clearcut/zzfx;
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:825)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:268)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:246)
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:417)
at brut.androlib.Androlib.buildNonDefaultSources(Androlib.java:363)
at brut.androlib.Androlib.build(Androlib.java:301)
at brut.androlib.Androlib.build(Androlib.java:267)
at brut.apktool.Main.cmdBuild(Main.java:238)
at brut.apktool.Main.main(Main.java:76)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x69
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1098)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:821)
... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65570
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:1058)
... 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, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)

Please help me with the solution.

Re: Error while deploying apk file

Posted: Mon Dec 03, 2018 9:10 am
by odklizec
Hi,

Unfortunately, there is not enough information regarding your issue. What Ranorex version do you use? If something older than most recent 8.3.1, then please update it first and try to rebuild your app again.

Also, check this post with apktool flags, which may eventually help you...
viewtopic.php?f=23&t=11947&p=47961#p48949

Re: Error while deploying apk file

Posted: Mon Dec 03, 2018 11:55 am
by Punashri M S
Thanks for the response.

Using 8.3 Ranorex version.

changed the instrumentation flag from -ststic to -multidex and also downgrade to an older version of the apk tool and tried but no use.

Regards,

Re: Error while deploying apk file

Posted: Mon Dec 03, 2018 12:21 pm
by Support Team
Hello Punashri,

Thank you for your posts.

Please try to use the flags -static and -multidex for instrumenting your app.

static_multidex.png

If the error still appears, may I ask you to create a new support ticket and attach the *.apk file?
This would help us to further analyze your issue.

Thank you in advance.

regards,
Stephan