Page 1 of 1

Instrumentation failed... Error deploying .apk

Posted: Wed Oct 26, 2016 2:33 pm
by Tomek
Hi,
I'm new to Ranorex and I had a problem recently trying to deploy .apk file to Android device.

Here are the screenshots from Ranorex Instrumentation Wizard:
Ranorex_instrumentation_Wizard_Error.png
Also screen with Android SDK Manager Info installed on my PC:
Android_SDK_Manager.png
Detailed info concerning error:

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: 66637
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:329)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1027)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:803)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:252)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:230)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:53)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:400)
at brut.androlib.Androlib.buildSources(Androlib.java:331)
at brut.androlib.Androlib.build(Androlib.java:287)
at brut.androlib.Androlib.build(Androlib.java:263)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:84)


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)

System info:

Ranorex version 6.1.1,
Ms Windows 7 64-bit,

Considering making sure of potential reasons of the problem which are mentioned on screen,
1. The APK is not obfuscated,
2. The API are using is 17 (Android 4.2.2)
3. No other version on APK is not installed on the device.

Please, help overcome this problem since we are about to decide whether or not moving to Ranorex for mobile automate testing.

Tomek

Re: Instrumentation failed... Error deploying .apk

Posted: Thu Oct 27, 2016 3:17 pm
by asdf
Hi Tomek,

Please try to set the instrumentation flag "-multidex" in the instrumentation wizard's settings.
Therefore, go to the instrumentation wizard and click on "Settings".
Ranorex Instrumentation Wizard.png
Afterwards, add "-multidex" to the field "Instrumentation Flags".
Settings.png
Hope this helps.

Kind regards,
asdf

Re: Instrumentation failed... Error deploying .apk

Posted: Fri Oct 28, 2016 10:05 am
by Tomek
Thanks asdf, it helps.:).
Although there was another problem with timeout's , but I overcome this with settings in Ranorex Recorder package.

Tomek