instrumention failed

Mobile Testing, Android App Testing.
Posts: 1
Joined: Tue Feb 02, 2016 10:01 am

instrumention failed

Post by karthik » Tue Feb 02, 2016 10:12 am


I was new user of ranorex and I was not able to deploy my APK to my android. I'm following the android user guide. I am using latest Ranorex and gets following error gets displayed

Instrumentation failed...

Please make sure that
- The API is not obfuscated.
- You are using API level 8 or above.
- No uninstrumented APK version is installed on the device.

And the error details are:

System.Exception: Failed to recompile the instrumented code. See details for more information: Exception in thread "main" org.jf.util.ExceptionWithContext: Unsigned short value out of range: 66746
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(
at org.jf.dexlib2.writer.InstructionWriter.write(
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(
at org.jf.dexlib2.writer.DexWriter.writeTo(
at org.jf.dexlib2.writer.DexWriter.writeTo(
at brut.androlib.Androlib.buildSourcesSmali(
at brut.androlib.Androlib.buildSources(
at brut.apktool.Main.cmdBuild(
at brut.apktool.Main.main(

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.Controls.Instrumentation.Workers.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)

Kindly help me from this issue

thanks and regards
karthikeyan s

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: instrumention failed

Post by Support Team » Wed Feb 03, 2016 2:08 pm

Hi Karthikeyan,

May I ask you to use the instrumentation flags as described in this posting?

Please do let me know if this solves the problem.
Thanks & Regards,
Markus (S)