Page 1 of 1

instrumentation fail

Posted: Wed Sep 25, 2013 4:39 am
by FrankQian
hey ranorex support team

when I tried to instrument my app using the apk file, it comes back will an error, and here is the error message

error message
---------------------------------------------------------------------------------------------------------------

System.Exception: Failed to decompile the APK file. See details for more information: I: Baksmaling...
I: Loading resource table...
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 6037
at java.lang.String.substring(Unknown Source)
at brut.androlib.res.decoder.StringBlock.getHTML(StringBlock.java:164)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:227)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:182)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:170)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:135)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:110)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
at brut.androlib.Androlib.getResTable(Androlib.java:50)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)

at Ranorex.Plugin.Mobile.PlatformComponents.DeviceBridges.ApkFileInstrumenter.DecompileApkFile(String apkFilePath, Boolean showProcessWindows, IPathService pathService)
at Ranorex.Plugin.Mobile.PlatformComponents.DeviceBridges.ApkFileInstrumenter.Instrument(String apkFilePath, Int32 port, BackgroundWorker bgw)
at Ranorex.Controls.Instrumentation.Workers.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)

Re: instrumentation fail

Posted: Thu Sep 26, 2013 2:42 pm
by Support Team
Hello,

Could you please send us ([email protected]) your APK file in order to analyze your issue?
Thank you.

Regards,
Markus (T)

Re: instrumentation fail

Posted: Thu Nov 21, 2013 9:25 pm
by samah
Hi, i have the same problem, what is the solution for this issue plz?

Re: instrumentation fail

Posted: Fri Nov 22, 2013 11:17 am
by Support Team
Hello samah,

I could successfully instrument your APK using our current Ranorex version (4.1.2).
In our current version, we added support for Android apps containing custom resources (see Release Notes).
Please update to Ranorex 4.1.2 which can be downloaded from our archive.

Thank you.

Regards,
Markus (T)

Re: instrumentation fail

Posted: Wed Oct 29, 2014 1:43 pm
by darius.popa
Hello,

I have the same issue using Ranorex 5.2 Here is the exception that I get

Code: Select all

System.Exception: Failed to decompile the APK file. See details for more information: Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
	at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:54)
	at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:604)
	at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
	at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
	at brut.androlib.Androlib.getResTable(Androlib.java:49)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:93)
	at brut.apktool.Main.cmdDecode(Main.java:169)
	at brut.apktool.Main.main(Main.java:85)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
	at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
	at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:43)
	at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:95)
	at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
	at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
	... 7 more

   at Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.DecompileApkFile(String apkFilePath, Boolean showProcessWindows, IPathService pathService, InstrumentApkOptions deployOptions)
   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)
Please let me know if anyone has any idea how to fix it.

Thank you,

Darius

Re: instrumentation fail

Posted: Mon Nov 03, 2014 3:51 pm
by Support Team
Hello all,

If you are facing the same issue, please contact [email protected]

This is a known issue and will be fixed within one of our next releases.

Regards,
Robert

Re: instrumentation fail

Posted: Mon Nov 03, 2014 3:53 pm
by darius.popa
This issue can be fixed by replacing the apktool.jar from C:\Program Files (x86)\Ranorex 5.2\Bin\RxEnv\Android\tools\apkTool with http://connortumbleson.com/2014/10/05/a ... -released/