instrumentation Failed

Mobile Testing, Android App Testing.
oubar
Posts: 8
Joined: Wed May 08, 2019 2:15 pm

instrumentation Failed

Post by oubar » Wed May 08, 2019 2:29 pm

Hi,

Im Using Ranonex last version 9.0.1, when i try to instrument my APK whith instrumentation Wizard, it's failes.

This is the command line :
Ranorex.Instrumentation.exe /device:USB-37e2bc9e /apkfile:C:\Users\%%\Desktop\X431_EUROPRO4_7.00.015.apk /skip:False /deploymode:Auto /FullImageComparison:True /EnableWebTesting:True /TreeSimplification:True /KeyStorePass:******* /KeyPass:******* /deploytimeout:0 /instrumenttimeout:0 /pagename:android /solutionsettings:"C:\Users\%%\Documents\Ranorex\RanorexStudio Projects\MyTest1\Ranorex.rxsettings" /help:False

i have also this detail :
System.TimeoutException: Process did not finish within the specified timeout of '00:02:00'.
à Ranorex.Common.Process.ProcessRunner.RunShortProcess(Boolean showWindow, TimeSpan timeout, IList`1 appendToPath, String workingDir)
à Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.DecompileApkFile(String apkFilePath, Boolean showProcessWindows, IPathService pathService, InstrumentApkOptions deployOptions)
à Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.Instrument(String apkFilePath, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
à Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
à Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)

PS : I have the latest apktool.jar
in attechement the APK

Can you help me ?

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

Re: instrumentation Failed

Post by Support Team » Wed May 08, 2019 9:04 pm

Hi Oubar,

This looks like you are just hitting the instrumentation timeout and may finish on its own if given more time. Try increasing this timeout in the Ranorex Settings (Start menu > Ranorex Settings 9).
1.png
If you continue to experience issues, please upload your APK file and I will be happy to troubleshoot this issue on my machine (it did not upload to your original post).

Cheers,
Ned
You do not have the required permissions to view the files attached to this post.

oubar
Posts: 8
Joined: Wed May 08, 2019 2:15 pm

Re: instrumentation Failed

Post by oubar » Thu May 09, 2019 11:04 am

thank you for your reply.
I tested the manipulation you suggested to me. the decompilation was successful against the re compilation failed. Here is the error message:
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 La/a;->a()Ljava/util/concurrent/ExecutorService;
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:917)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:341)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:297)
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:419)
at brut.androlib.Androlib.buildSources(Androlib.java:350)
at brut.androlib.Androlib.build(Androlib.java:302)
at brut.androlib.Androlib.build(Androlib.java:269)
at brut.apktool.Main.cmdBuild(Main.java:247)
at brut.apktool.Main.main(Main.java:79)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0xa
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1190)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:913)
... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65722
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:1150)
... 11 more


à Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.CompileApkFile(String sourceApkFilePath, IPathService pathService)
à Ranorex.Plugin.Mobile.Utils.BackgroundWorkerSupported.ExecuteBgwCode[TArg0,TArg1](BgwDelegate`2 methodDelegate, Int32 doneProgress, String progressText, TArg0 arg0, TArg1 arg1, BackgroundWorker bgw)
à Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.Instrument(String apkFilePath, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
à Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
à Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)

For the APK the size is very big for the uploder. I put it under:
https://transfernow.net/12kxi1f1qhca

Best regards

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

Re: instrumentation Failed

Post by odklizec » Thu May 09, 2019 11:07 am

Hi,

Try to apply the instrumentation flags from this post:
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

oubar
Posts: 8
Joined: Wed May 08, 2019 2:15 pm

Re: instrumentation Failed

Post by oubar » Thu May 09, 2019 11:36 am

thank you very much,
it works!