Error when instrumenting android app

Mobile Testing, Android App Testing.
thilina
Posts: 28
Joined: Wed Sep 03, 2014 12:32 pm

Error when instrumenting android app

Post by thilina » Thu Oct 26, 2017 11:00 am

Error when instrumenting android app

i get below error during the instrumenting of the app.

Code: Select all

System.Exception: Failed to recompile the instrumented code. See details for more information: 
W: C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\barcode_btn_64x48.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
W: C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\ic_add.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
W: C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\mwl_shadow.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited

W: C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\res\values-v24\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Animation.OptionsPanel'.
W: 
W: C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\res\values-v24\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Animation.LockScreen'.
W: 
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\thi.SL\AppData\Local\Temp\brut_util_Jar_3337884665805429366.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 23, --version-code, 1000001, --version-name, 4.173.0.30, -F, C:\Users\thi.SL\AppData\Local\Temp\APKTOOL4356024055081820788.tmp, -0, arsc, -0, dat, -0, cfg, -0, dat_chunk_4, -0, arsc, -I, C:\Users\thi.SL\AppData\Local\apktool\framework\1.apk, -S, C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\res, -M, C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\AndroidManifest.xml]
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:473)
	at brut.androlib.Androlib.buildResources(Androlib.java:407)
	at brut.androlib.Androlib.build(Androlib.java:306)
	at brut.androlib.Androlib.build(Androlib.java:263)
	at brut.apktool.Main.cmdBuild(Main.java:224)
	at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\thi.SL\AppData\Local\Temp\brut_util_Jar_3337884665805429366.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 23, --version-code, 1000001, --version-name, 4.173.0.30, -F, C:\Users\thi.SL\AppData\Local\Temp\APKTOOL4356024055081820788.tmp, -0, arsc, -0, dat, -0, cfg, -0, dat_chunk_4, -0, arsc, -I, C:\Users\thi.SL\AppData\Local\apktool\framework\1.apk, -S, C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\res, -M, C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:439)
	at brut.androlib.Androlib.buildResourcesFull(Androlib.java:459)
	... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\thi.SL\AppData\Local\Temp\brut_util_Jar_3337884665805429366.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 23, --version-code, 1000001, --version-name, 4.173.0.30, -F, C:\Users\thi.SL\AppData\Local\Temp\APKTOOL4356024055081820788.tmp, -0, arsc, -0, dat, -0, cfg, -0, dat_chunk_4, -0, arsc, -I, C:\Users\thi.SL\AppData\Local\apktool\framework\1.apk, -S, C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\res, -M, C:\Users\thi.SL\AppData\Local\RanorexStudio6\RxEnv\Android\temp\decomp\AndroidManifest.xml]
	at brut.util.OS.exec(OS.java:95)
	at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:433)
	... 6 more

   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)
i'm using Ranorex 6.1.1

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

Re: Error when instrumenting android app

Post by odklizec » Thu Oct 26, 2017 11:27 am

Hi,

Ranorex 6.1.1 is way too old (over year old) and no longer supported. I would recommend to update to Ranorex 7.2 and check if the problem still exists in this version. The only other thing you can probably do is to search this forum for similar topics and try the solutions suggested in these posts.
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

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

Re: Error when instrumenting android app

Post by Support Team » Thu Oct 26, 2017 8:39 pm

Hello thilina,

Thank you for posting in the Ranorex forums.

I believe that odklizec is correct that this could be related to the older version of Ranorex studio, so we need to see if the issue is still occurring using the latest version of Ranorex studio. Please contact Ranorex support for download instructions if you would like to attempt to try a new version.

I is also recommended that you contact [email protected] If you continue to run into this issue with the latest version.

Sincerely,

- M. Kendall McIntosh
Automation Support Engineer
.
Image

thilina
Posts: 28
Joined: Wed Sep 03, 2014 12:32 pm

Re: Error when instrumenting android app

Post by thilina » Mon Oct 30, 2017 5:41 am

could fix this by updating the apktool manually to latest version.

apktool is here
C:\Program Files (x86)\Ranorex 6.1\Bin\RxEnv\Android\tools\apkTool

after that make sure to delete 1.apk below as well
%UserProfile%\AppData\Local\apktool\framework