Instrumentation failed

Mobile Testing, Android App Testing.
isouza
Posts: 3
Joined: Thu Jun 13, 2019 8:59 pm

Instrumentation failed

Post by isouza » Thu Jun 13, 2019 9:10 pm

Hi all!

I'm using Ranorex 9.1, Windows 10 Pro and have the error bellow:

Instrumentation failed

Please make sure that:

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

I readed many topics like this here, but none solved my problem.
My APK is made in FireMonkey (Delphi Rio 10.3) and meets requirements above.

If i click in "Details", i receive the error bellow:

System.Exception: Failed to recompile the instrumented code.
See details for more information: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = -1073741515): [C:\Users\Ivan\AppData\Local\Temp\brut_util_Jar_674880722489268900.tmp, p, --forced-package-id, 127, --min-sdk-version, 19, --target-sdk-version, 28, --version-code, 10, --version-name, 1.0.10, --no-version-vectors, -F, C:\Users\Ivan\AppData\Local\Temp\APKTOOL715418112790319657.tmp, -0, arsc, -0, wav, -0, png, -0, arsc, -I, C:\Users\Ivan\AppData\Local\apktool\framework\1.apk, -S, C:\Users\Ivan\AppData\Local\RanorexStudio9\RxEnv\Android\temp\decomp\res, -M, C:\Users\Ivan\AppData\Local\RanorexStudio9\RxEnv\Android\temp\decomp\AndroidManifest.xml]

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


Anyone can help me?

Best regards,

Ivan

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

Re: Instrumentation failed

Post by Support Team » Fri Jun 14, 2019 10:00 am

Hello Isouza,

Thank you for your post.

This instrumentation error is most likely related to a bug in the apktool itself.
Ranorex uses the apktool to instrument Android apps.

Please try to perform the following steps and let us know if this resolves your problem:

1. Download the two files from the following link: https://upload.ranorex.com/s/Y4CXQmSnMpQpixr
2. Rename the apktool_4.2.1.jar to "apktool.jar"
3. Replace the old apktool.jar from the following folder with the new one:
C:\Program Files (x86)\Ranorex <Ranorex Version>\Bin\RxEnv\Android\tools\apkTool
4. Delete the 1.apk file from the following directories (if available)
%userprofile%\apktool\framework
%localappdata%\apktool\framework
%temp%
5. Unzip the appt.zip file and copy the files to:
6. %temp%

I hope, these steps help and you're able to instrument your app afterwards.

Kind regards,
Stephan
.
Image

isouza
Posts: 3
Joined: Thu Jun 13, 2019 8:59 pm

Re: Instrumentation failed

Post by isouza » Fri Jun 14, 2019 3:00 pm

Thank you Stephan!

Solved my problem!

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

Re: Instrumentation failed

Post by Support Team » Mon Jun 17, 2019 8:49 am

I',m glad I could help.
You're welcome.

regards,
Stephan
.
Image