Error while deploying apk file

Mobile Testing, Android App Testing.
Punashri M S
Posts: 12
Joined: Tue Jan 30, 2018 12:56 pm

Error while deploying apk file

Post by Punashri M S » Mon Dec 03, 2018 5:55 am

Hello All,

Am facing a issue while deploying the apk file.

Find the attached file for error message.
Error.png
Error.png (116.98 KiB) Viewed 51 times
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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4047
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Error while deploying apk file

Post by odklizec » Mon Dec 03, 2018 9:10 am

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
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Punashri M S
Posts: 12
Joined: Tue Jan 30, 2018 12:56 pm

Re: Error while deploying apk file

Post by Punashri M S » Mon Dec 03, 2018 11:55 am

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,

User avatar
Support Team
Site Admin
Site Admin
Posts: 11720
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Error while deploying apk file

Post by Support Team » Mon Dec 03, 2018 12:21 pm

Hello Punashri,

Thank you for your posts.

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

static_multidex.png
static_multidex.png (12.66 KiB) Viewed 34 times

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
.
Image