instrumentation fail

Mobile Testing, Android App Testing.
FrankQian
Posts: 1
Joined: Wed Sep 25, 2013 4:34 am

instrumentation fail

Post by FrankQian » Wed Sep 25, 2013 4:39 am

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)
Attachments
Capture.PNG
Capture.PNG (63.24 KiB) Viewed 3235 times

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

Re: instrumentation fail

Post by Support Team » Thu Sep 26, 2013 2:42 pm

Hello,

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

Regards,
Markus (T)
.
Image

samah
Posts: 1
Joined: Thu Nov 21, 2013 2:49 pm

Re: instrumentation fail

Post by samah » Thu Nov 21, 2013 9:25 pm

Hi, i have the same problem, what is the solution for this issue plz?

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

Re: instrumentation fail

Post by Support Team » Fri Nov 22, 2013 11:17 am

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)
.
Image

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: instrumentation fail

Post by darius.popa » Wed Oct 29, 2014 1:43 pm

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

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

Re: instrumentation fail

Post by Support Team » Mon Nov 03, 2014 3:51 pm

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
.
Image

darius.popa
Posts: 20
Joined: Wed Jan 08, 2014 5:15 pm

Re: instrumentation fail

Post by darius.popa » Mon Nov 03, 2014 3:53 pm

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/