instrumentation fails on external library

Mobile Testing, Android App Testing.
zivshapirawork
Posts: 62
Joined: Wed Sep 24, 2014 7:47 am
Location: Israel

instrumentation fails on external library

Post by zivshapirawork » Wed Mar 18, 2015 11:41 am

Hi

I am trying to instrument an apk (Android app) via Ranorex 5.3.0. I am getting the error below on an external jar dependency called 'com.android.support:appcompat-v7:21.0.3'

as far as we can tell it is not obfuscated, as well as the whole apk.
Has anyone come across this issue?

thanks

this is the part in the XML from the jar with the value true

Code: Select all

            android:touchscreenBlocksFocus="true"
this is the instrumentation error
System.Exception: Failed to decompile the APK file. See details for more information: W: Could not decode attr value, using undecoded value instead: ns=android, name=touchscreenBlocksFocus, value=0xffffffff
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x0101048f
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:59)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:57)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:53)
at brut.androlib.res.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:36)
at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlResourceParser.java:369)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(XmlPullParserDelegate.java:69)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:83)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:141)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamDecoderContainer.java:33)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:114)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:99)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:323)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:101)
at brut.apktool.Main.cmdDecode(Main.java:165)
at brut.apktool.Main.main(Main.java:81)
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true

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)

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

Re: instrumentation fails on external library

Post by Support Team » Thu Mar 19, 2015 10:20 am

Hello zivshapirawork,

May I ask if you could send the APK to [email protected]. This would help us in analyzing your issue in more detail.

Thanks,
Robert
.
Image

zivshapirawork
Posts: 62
Joined: Wed Sep 24, 2014 7:47 am
Location: Israel

Re: instrumentation fails on external library

Post by zivshapirawork » Thu Mar 19, 2015 2:00 pm

Hello Robert

thanks for the reply :) Unfortunately I cannot send the apk, but the error is about an android-support standard jar and not with the inhouse code. Therefore I asked if anyone has seen this specific issue.

it is possible to get the jar (not in an apk) here if that helps
https://github.com/koush/android-suppor ... compat.jar

Thank you
Ziv

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

Re: instrumentation fails on external library

Post by Support Team » Mon Mar 23, 2015 8:56 am

Hello Ziv,

Unfortunately, we are not aware of any issues with the Android Support lib.

Please try to delete the apktool-folder, which can be found within your user folder (%Userprofile%).

If you are still not able to instrument the application, you could try upgrade the apktool, which is stored in the installation folder of Ranorex, usually “C:\Program Files (x86)\Ranorex 5.3\Bin\RxEnv\Android\tools\apkTool”. The newest apk tool can be found here: Apktool v2.0.0 RC4 Released

Please let us know if it worked after applying the mentioned steps.

Regards,
Robert
.
Image

zivshapirawork
Posts: 62
Joined: Wed Sep 24, 2014 7:47 am
Location: Israel

Re: instrumentation fails on external library

Post by zivshapirawork » Mon Mar 23, 2015 1:07 pm

Hi Robert

The solution worked to resolve the issue that I had mentioned, even just removing the apktool/ dir. Then the error does not appear.

Now the instrumentation fails on time (does not end after 2 minutes), but I will report this in another thread.

Thank you
Ziv Shapira