Instrumentation failed:java.lang.IllegalArgumentException

Mobile Testing, Android App Testing.
kissKurisu
Posts: 7
Joined: Wed Oct 18, 2017 8:51 am

Instrumentation failed:java.lang.IllegalArgumentException

Post by kissKurisu » Tue Mar 13, 2018 8:46 am

Hi,
While using instrumentation wizard,the error occurred.We have sought advice from our developers,but no help.We want to know it's the problem of our apk or ranorex,and how to fix it.

Operating system: Win7 sp1
Ranorex version: 7.2.1

The APK is not obfuscated. Yes.
You are using API level 8 or above. Yes.
No uninstrumented APK version is installed on the device. Yes.

Error detail

Code: Select all

System.Exception: Failed to recompile the instrumented code. See details for more information: S: WARNING: Could not write to (C:\Users\taurus\AppData\Local\apktool\framework), using C:\Users\taurus\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
Exception in thread "main" java.lang.IllegalArgumentException: MALFORMED
	at java.util.zip.ZipCoder.toString(Unknown Source)
	at java.util.zip.ZipFile.getZipEntry(Unknown Source)
	at java.util.zip.ZipFile.access$900(Unknown Source)
	at java.util.zip.ZipFile$ZipEntryIterator.next(Unknown Source)
	at java.util.zip.ZipFile$ZipEntryIterator.nextElement(Unknown Source)
	at java.util.zip.ZipFile$ZipEntryIterator.nextElement(Unknown Source)
	at brut.androlib.Androlib.copyExistingFiles(Androlib.java:622)
	at brut.androlib.Androlib.buildUnknownFiles(Androlib.java:607)
	at brut.androlib.Androlib.build(Androlib.java:326)
	at brut.androlib.Androlib.build(Androlib.java:270)
	at brut.apktool.Main.cmdBuild(Main.java:224)
	at brut.apktool.Main.main(Main.java:75)

   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, Int32 port, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
   at Ranorex.Controls.Instrumentation.Workers.AndroidWorker.Run()
   at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)
Thanks.
Attachments
20180313154430.png
20180313154430.png (29.99 KiB) Viewed 572 times

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: Instrumentation failed:java.lang.IllegalArgumentException

Post by asdf » Wed Mar 14, 2018 3:15 pm

Hi,

This issue sounds like a permission issue to me. May I ask you if you have started the Instrumentation Wizard with administrator privileges? And have you checked if the path "C:\Users\taurus\AppData\Local\apktool\framework" is available and accessible on your machine?

kissKurisu
Posts: 7
Joined: Wed Oct 18, 2017 8:51 am

Re: Instrumentation failed:java.lang.IllegalArgumentException

Post by kissKurisu » Thu Mar 15, 2018 7:18 am

Hi,

Thanks for your suggestion,asdf.And we have found the problem is that our apk includs some files with Chinese character name.

The apk was zipped with UTF-8,if we change to gbk or name files with Engish char,there will be no error.

Hope this could help others.