Hi ,
Im Using Ranonex last version 9.0.1 and when im trying to run my apk in order for making test . In the End i received " Instrumentation Failed"
with :
System.Exception: Failed to recompile the instrumented code. See details for more information: S: WARNING: Could not write to (C:\Users\Alex\AppData\Local\apktool\framework), using C:\Users\Alex\AppData\Local\Temp\ instead...
S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
W: C:\Users\Alex\AppData\Local\RanorexStudio9\RxEnv\Android\temp\decomp\res\values\public.xml:50: error: Public symbol array/countries declared here is not defined.
W: C:\Users\Alex\AppData\Local\RanorexStudio9\RxEnv\Android\temp\decomp\res\values\public.xml:51: error: Public symbol array/currencies
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, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)
Cant run any apk i tried my apktool is last version and the Ranorex 9.0.1
Please help
Failed to recompile the instrumented code
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Failed to recompile the instrumented code
Hi alexkz,
This appears to be related to an old ApkTool bug. Please follow the steps below to manually update the ApkTool used by Ranorex.
Regards,
Ned
This appears to be related to an old ApkTool bug. Please follow the steps below to manually update the ApkTool used by Ranorex.
- Download the newest version of the ApkTool (2.4.0) - https://bitbucket.org/iBotPeaches/apktool/downloads/
- Navigate to the following folder in the Ranorex install directory and rename the current apktool to apktool-old
- Copy the downloaded apktool_2.4.0 to the same folder and rename to apktool so the folder should look like the below image
- Delete any 1.apk files in your %userprofile%\apktool\framework or %localappdata%\apktool\framework or %temp%
- Instrument your APK via the Ranorex instrumentation wizard as usual with the appropriate instrumentation flags
Regards,
Ned
You do not have the required permissions to view the files attached to this post.
Re: Failed to recompile the instrumented code
Hey ,
Thanks for reply , now i receive :
System.Exception: Failed to decompile the APK file. See details for more information: Error: Unable to access jarfile C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\tools\apkTool\apktool.jar
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, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)
Thanks for reply , now i receive :
System.Exception: Failed to decompile the APK file. See details for more information: Error: Unable to access jarfile C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\tools\apkTool\apktool.jar
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, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)
Re: Failed to recompile the instrumented code
Hi alexkz,
Are you sure the "apktool.jar" is still there? While replacing it, you might have named it incorrectly.
Post a screenshot of the folder "C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\tools\apkTool". It's very likely that the "apktool.jar" is actually not there anymore or has a different name.
Regards,
McTurtle
Are you sure the "apktool.jar" is still there? While replacing it, you might have named it incorrectly.
Post a screenshot of the folder "C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\tools\apkTool". It's very likely that the "apktool.jar" is actually not there anymore or has a different name.
Regards,
McTurtle
Re: Failed to recompile the instrumented code
I have , see attachment . I even download new last version of apktool and rename it .
But maybe the issue also is when im going to cmd and writing : apktool
i have receiving : Unable to access jarfile C:\Windows\\apktool.jar
But maybe the issue also is when im going to cmd and writing : apktool
i have receiving : Unable to access jarfile C:\Windows\\apktool.jar
You do not have the required permissions to view the files attached to this post.
Re: Failed to recompile the instrumented code
Hello alexkz,
OK, I am a bit confused
Why are you even opening cmd and writing "apktool"? If you only open cmd from the stat menu and type "apktool" then you will get the error that you are getting. You need to navigate to the folder where the apk-tool is located and start it via "java -jar...". But why would you even try to do that?
Secondly, the screenshot in your last post says that the apk-tool is 10.7 MB large. However, apk-tool 2.4 is more than 15 MB large. So it seems that you did not do the steps suggested by Ned correctly Can you try again to replace the apk-tool and then use it via the Ranorex instrumentation wizard and not directly via cmd?
Regards,
McTurtle
OK, I am a bit confused
Why are you even opening cmd and writing "apktool"? If you only open cmd from the stat menu and type "apktool" then you will get the error that you are getting. You need to navigate to the folder where the apk-tool is located and start it via "java -jar...". But why would you even try to do that?
Secondly, the screenshot in your last post says that the apk-tool is 10.7 MB large. However, apk-tool 2.4 is more than 15 MB large. So it seems that you did not do the steps suggested by Ned correctly Can you try again to replace the apk-tool and then use it via the Ranorex instrumentation wizard and not directly via cmd?
Regards,
McTurtle
Re: Failed to recompile the instrumented code
I did it and change to new one 15MB
and then i got too Ranorex Instrumentation Wizard and in the end i get : (the same i think)
System.Exception: Failed to decompile the APK file. See details for more information: Error: Unable to access jarfile C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\tools\apkTool\apktool.jar
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, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)
and then i got too Ranorex Instrumentation Wizard and in the end i get : (the same i think)
System.Exception: Failed to decompile the APK file. See details for more information: Error: Unable to access jarfile C:\Program Files (x86)\Ranorex\Studio\Bin\RxEnv\Android\tools\apkTool\apktool.jar
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, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.RxIntegration.Instrumentation.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)
Re: Failed to recompile the instrumented code
Hi alexkz,
You also have file extensions disabled, else a *.bat would be visible for the batch file. That means that your apktool.jar is actually apktool.jar.jar.
Enable the file extensions and then make sure the file does not have two extensions. Does it work now?
Regards,
McTurtle
You also have file extensions disabled, else a *.bat would be visible for the batch file. That means that your apktool.jar is actually apktool.jar.jar.
Enable the file extensions and then make sure the file does not have two extensions. Does it work now?
Regards,
McTurtle
You do not have the required permissions to view the files attached to this post.