Page 1 of 1

System failed to instrument application. Invalid resource directory.

Posted: Wed Nov 07, 2018 3:21 pm
by craigwp
Hi Everyone,

Got some trouble when instrumenting an application through the wizard.

Currently on Ranorex version 9.8.0+git.994387e4.

The error log is attached as a file. Hoping someone has had a similar issue and has a solution.

On the other hand, is there a way to instrument an application from code in say androidSDK ?

Re: System failed to instrument application. Invalid resource directory.

Posted: Fri Nov 09, 2018 9:59 am
by odklizec
Hi

At first, are try to delete (manually) entire framework dir, located here:
C:\Users\craigwp\AppData\Local\apktool\framework
If you are not able to delete this dir, restart PC and try it again. BTW, do you have admin privileges on that PC?
What OS are you using?
Try to start the Ranorex instrumentation wizard as administrator.

If nothing from the above helps, then there is most probably something wrong with your PC? Maybe you don't have enough privileges or there is a group policy/antivirus settings, preventing you (instrumentation wizard) from modifying the framework directory? Could you please try it on another PC/virtual machine?

Re: System failed to instrument application. Invalid resource directory.

Posted: Fri Nov 09, 2018 12:39 pm
by qwertzu
hey craigwp,

I've seen this instrumentation error before.
This seems to be a bug in the apk tool itself and therefore is not related to Ranorex. I had the same issue and tried to instrument the app via apktool without using Ranorex. The same error appeared.

So, I downgraded the apktool and afterwards, I was able to instrument the app.
I'm now using apktool version 2.3.2.
So please download this version here: https://connortumbleson.com/2018/04/07/ ... -released/

In order to make sure Ranorex uses this apktool version, you need to unpack the *.jar file, rename the file to "apktool.jar" and replace it with the existing one in this directory on your machine: C:\Program Files (x86)\Ranorex 8.3\Bin\RxEnv\Android\tools\apkTool

Afterwards, please delete the temporary files as Pavel already suggested, just to make sure that all old files get renewed.

Hope, this helps.
regards, qwertzu