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
Instrumentation failed
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Instrumentation failed
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/BSPRJkX53qjax4Q
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
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/BSPRJkX53qjax4Q
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
Re: Instrumentation failed
Thank you Stephan!
Solved my problem!
Solved my problem!
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Instrumentation failed
I',m glad I could help.
You're welcome.
regards,
Stephan
You're welcome.
regards,
Stephan
Re: Instrumentation failed
Hello everyone!
Could you please actualize the link? I have the same issue, but the file is not available now when following the link.
Could you please actualize the link? I have the same issue, but the file is not available now when following the link.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Instrumentation failed
Hi dietowin,
Here you go: https://upload.ranorex.com/s/BSPRJkX53qjax4Q
I also updated the original post link. Note, this will be officially included in the next release of Ranorex (9.1.2 - ETA early September)
Cheers,
Ned
Re: Instrumentation failed
Thank you very much!Support Team wrote: ↑Fri Aug 23, 2019 3:26 pmHi dietowin,
Here you go: https://upload.ranorex.com/s/BSPRJkX53qjax4Q
I also updated the original post link. Note, this will be officially included in the next release of Ranorex (9.1.2 - ETA early September)
Cheers,
Ned
Best regards,
dietowin
Re: Instrumentation failed
I have been facing the issue of auto instrumentation failed while integrating dynatrace. I have using multidex configuration application. can anyone provide the answer for me earliest. I have look into this issue for past one week.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Instrumentation failed
Hello Isla90,
I would make sure you are using the -multdex flag when instrumenting, if the issue persists, please provide the exception details so that we may further investigate.
Regards,
Sean
I would make sure you are using the -multdex flag when instrumenting, if the issue persists, please provide the exception details so that we may further investigate.
Regards,
Sean
You do not have the required permissions to view the files attached to this post.
Re: Instrumentation failed
Hello,
I am a first time user trialing this software.
I am hitting a similar exception upon instrumentation of the APK.
I already tried the above suggestion (-multidex).
Any other ideas?
Below is the error stack:
System.InvalidOperationException: Failed to recompile the instrumented code. See details for more information: S: WARNING: Could not write to (C:\Users\aghosn\AppData\Local\apktool\framework), using C:\Users\aghosn\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = -1073741515): [C:\Users\aghosn\AppData\Local\Temp\brut_util_Jar_7762335007843478658.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 27, --version-code, 1908200332, --version-name, 4.8.44.7, --no-version-vectors, -F, C:\Users\aghosn\AppData\Local\Temp\APKTOOL1552020771754950403.tmp, -0, arsc, -0, png, -0, res/drawable-hdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-hdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-hdpi-v4/notification_bg_normal.9.png, -0, res/drawable-hdpi-v4/notification_bg_normal_pressed.9.png, -0, res/drawable-mdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-mdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-mdpi-v4/notification_bg_normal.9.png, -0, res/drawable-mdpi-v4/notification_bg_normal_pressed.9.png, -0, res/drawable-xhdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-xhdpi-v4/notification_bg_normal.9.png, -0, res/drawable-xhdpi-v4/notification_bg_normal_pressed.9.png, -0, ogg, -0, arsc, -I, C:\Users\aghosn\AppData\Local\Temp\1.apk, -S, C:\Users\aghosn\AppData\Local\RanorexStudio9\RxEnv\Android\temp\decomp\res, -M, C:\Users\aghosn\AppData\Local\RanorexStudio9\RxEnv\Android\temp\decomp\AndroidManifest.xml]
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)
I am a first time user trialing this software.
I am hitting a similar exception upon instrumentation of the APK.
I already tried the above suggestion (-multidex).
Any other ideas?
Below is the error stack:
System.InvalidOperationException: Failed to recompile the instrumented code. See details for more information: S: WARNING: Could not write to (C:\Users\aghosn\AppData\Local\apktool\framework), using C:\Users\aghosn\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = -1073741515): [C:\Users\aghosn\AppData\Local\Temp\brut_util_Jar_7762335007843478658.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 27, --version-code, 1908200332, --version-name, 4.8.44.7, --no-version-vectors, -F, C:\Users\aghosn\AppData\Local\Temp\APKTOOL1552020771754950403.tmp, -0, arsc, -0, png, -0, res/drawable-hdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-hdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-hdpi-v4/notification_bg_normal.9.png, -0, res/drawable-hdpi-v4/notification_bg_normal_pressed.9.png, -0, res/drawable-mdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-mdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-mdpi-v4/notification_bg_normal.9.png, -0, res/drawable-mdpi-v4/notification_bg_normal_pressed.9.png, -0, res/drawable-xhdpi-v4/notification_bg_low_normal.9.png, -0, res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png, -0, res/drawable-xhdpi-v4/notification_bg_normal.9.png, -0, res/drawable-xhdpi-v4/notification_bg_normal_pressed.9.png, -0, ogg, -0, arsc, -I, C:\Users\aghosn\AppData\Local\Temp\1.apk, -S, C:\Users\aghosn\AppData\Local\RanorexStudio9\RxEnv\Android\temp\decomp\res, -M, C:\Users\aghosn\AppData\Local\RanorexStudio9\RxEnv\Android\temp\decomp\AndroidManifest.xml]
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)
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Instrumentation failed
Hello aboughosn,
This is most probably an issue that was fixed in Ranorex 9.1.2. Please install this version of Ranorex and add the instrumentation flag "-nores" and try to instrument the application again.
This should solve the issue.
Regards,
Bernhard
This is most probably an issue that was fixed in Ranorex 9.1.2. Please install this version of Ranorex and add the instrumentation flag "-nores" and try to instrument the application again.
This should solve the issue.
Regards,
Bernhard
You do not have the required permissions to view the files attached to this post.
Re: Instrumentation failed
-nores option worked.
I was already using version 9.1.2
Thanks!
I was already using version 9.1.2
Thanks!
Re: Instrumentation failed
Hello all,
I have another kind of failure
i'm using version 9.1.2.
I tried instrumentation by using this flag : -static -multidex -nores -smali_redist
I have this errors :
System.NotSupportedException: AndroidManifest.xml is of unsupported/unrecognized file format. Expected file formats are pure human readable xml or Android xml binary format.
à Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.AndroidManifest.ReadAndroidManifest(String fileName)
à Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.ProcessManifest(String manifestPath, DecompileInfo& dcInfo, InstrumentApkOptions instrumentOptions)
à 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)
Any idea ?
I have another kind of failure
i'm using version 9.1.2.
I tried instrumentation by using this flag : -static -multidex -nores -smali_redist
I have this errors :
System.NotSupportedException: AndroidManifest.xml is of unsupported/unrecognized file format. Expected file formats are pure human readable xml or Android xml binary format.
à Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.AndroidManifest.ReadAndroidManifest(String fileName)
à Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.ProcessManifest(String manifestPath, DecompileInfo& dcInfo, InstrumentApkOptions instrumentOptions)
à 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)
Any idea ?
-
- Posts: 2
- Joined: Thu Apr 18, 2019 9:26 am
Re: Instrumentation failed
Hi,
If this kind of exception there is, then check one more time, however without -nores option.
If the problem will still exist then provide the application, if possible.
Kind regards,
Marcin
If this kind of exception there is, then check one more time, however without -nores option.
If the problem will still exist then provide the application, if possible.
Kind regards,
Marcin