Page 1 of 1

Instrumented Android APK failed (Error occurred)

Posted: Mon Apr 18, 2016 4:20 pm
by igerasim
Hello, can not install our company app on devices. Facing following issues:

1) The APK is not obfuscated.
2) You are using API Level 8 or above. (I have API Level 17 installed)
3) No uninstrumented APK Version is installed on the device.

Using Ranorex 5.4.5.19886

System.Exception: Failed to recompile the instrumented code. See details for more information: libpng error: Not a PNG file
ERROR: Failure processing PNG image C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\archive_back.png
libpng error: Not a PNG file
ERROR: Failure processing PNG image C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\foxnow.png
libpng error: Not a PNG file
ERROR: Failure processing PNG image C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\hbogo.png
libpng error: Not a PNG file
ERROR: Failure processing PNG image C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\prg_blocked.png
libpng error: Not a PNG file
ERROR: Failure processing PNG image C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\shodexter.png
libpng error: Not a PNG file
ERROR: Failure processing PNG image C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\drawable-hdpi-v4\subtitles.png
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:336: error: Public symbol drawable/activity_indicator declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:337: error: Public symbol drawable/activity_indicator_dark declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:338: error: Public symbol drawable/activity_indicator_small declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:3: error: Public symbol drawable/android_dvr_alert_hh declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:4: error: Public symbol drawable/android_mic declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:5: error: Public symbol drawable/android_remote_alert_hh declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:339: error: Public symbol drawable/archive_back declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:340: error: Public symbol drawable/archive_bg declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:341: error: Public symbol drawable/archive_tap_bg declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:342: error: Public symbol drawable/asset_screen_back declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:6: error: Public symbol drawable/auto_wifi_click_states declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:343: error: Public symbol drawable/autowifi_back_button declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:7: error: Public symbol drawable/autowifi_back_button_states declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:344: error: Public symbol drawable/autowifi_backward declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:345: error: Public symbol drawable/autowifi_bottom_bar declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:346: error: Public symbol drawable/autowifi_forward declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:347: error: Public symbol drawable/autowifi_menu_bar declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:348: error: Public symbol drawable/autowifi_refresh declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:8: error: Public symbol drawable/back_button_selector declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:349: error: Public symbol drawable/back_button_tapstate declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:350: error: Public symbol drawable/back_sel declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:351: error: Public symbol drawable/backward_disabled declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:352: error: Public symbol drawable/backward_tapstate declared here is not defined.
...
...
...

C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:335: error: Public symbol drawable/volumebackground declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:2084: error: Public symbol drawable/volumebutton declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:2085: error: Public symbol drawable/volumeslider declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:111: error: Public symbol drawable/vs_logo declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:2086: error: Public symbol drawable/watch_on_tvpicker_icon declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:2087: error: Public symbol drawable/wifi_dialog declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:112: error: Public symbol drawable/wifibackward_click_state declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:113: error: Public symbol drawable/wififorward_click_state declared here is not defined.
C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res\values\public.xml:114: error: Public symbol drawable/wifirefresh_click_state declared here is not defined.
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Dell\AppData\Local\Temp\brut_util_Jar_3577956265317923665.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --version-code, 7, --version-name, 4.4.0.7, -F, C:\Users\Dell\AppData\Local\Temp\APKTOOL1198978393890178217.tmp, -0, arsc, -0, zip, -0, dat, -0, PNG, -0, arsc, -I, C:\Users\Dell\apktool\framework\1.apk, -S, C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res, -M, C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:472)
at brut.androlib.Androlib.buildResources(Androlib.java:410)
at brut.androlib.Androlib.build(Androlib.java:298)
at brut.androlib.Androlib.build(Androlib.java:268)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Dell\AppData\Local\Temp\brut_util_Jar_3577956265317923665.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --version-code, 7, --version-name, 4.4.0.7, -F, C:\Users\Dell\AppData\Local\Temp\APKTOOL1198978393890178217.tmp, -0, arsc, -0, zip, -0, dat, -0, PNG, -0, arsc, -I, C:\Users\Dell\apktool\framework\1.apk, -S, C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res, -M, C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:425)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:458)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Dell\AppData\Local\Temp\brut_util_Jar_3577956265317923665.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --version-code, 7, --version-name, 4.4.0.7, -F, C:\Users\Dell\AppData\Local\Temp\APKTOOL1198978393890178217.tmp, -0, arsc, -0, zip, -0, dat, -0, PNG, -0, arsc, -I, C:\Users\Dell\apktool\framework\1.apk, -S, C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\res, -M, C:\Users\Dell\AppData\Local\RanorexStudio5\RxEnv\Android\temp\decomp\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:419)
... 6 more

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)

Re: Instrumented Android APK failed (Error occurred)

Posted: Tue Apr 19, 2016 9:21 am
by Support Team
Hello igerasim,

Please try to remove the „1.apk“-file from the following location: “%Userprofile%\apktool\framework
After that, please try again to instrument the current version of your APK.

Please let me know if this resolves the issue.

Sincerely,
Johannes

Re: Instrumented Android APK failed (Error occurred)

Posted: Wed Apr 20, 2016 2:44 am
by igerasim
I tried to remove, but it did not help. I tried "-static -multidex" as well, but no luck. Do you have other ideas how can I install app?

Thank you in advance,
Ilya Gerasimov

Re: Instrumented Android APK failed (Error occurred)

Posted: Wed Apr 20, 2016 1:44 pm
by Support Team
Hi Ilya Gerasimov,

Would it be possible to send the corresponding APK file to [email protected]? This would help us analyzing the issue. We could also sign an NDA if it will be required from your side.

Thank you in advance.

Sincerely,
Johannes

Re: Instrumented Android APK failed (Error occurred)

Posted: Wed Apr 20, 2016 2:25 pm
by igerasim
Hello,
I send you apk file to provided email

Re: Instrumented Android APK failed (Error occurred)

Posted: Thu Apr 21, 2016 9:41 am
by Support Team
Hi Ilya Gerasimov,

Unfortunately, we didn't receive your email. Could you try contacting us again?
Please try sending the email without the attachment. Afterwards, I will send you the FTP credentials in order you can upload the APK.

Thank you in advance.

Sincerely,
Johannes

Re: Instrumented Android APK failed (Error occurred)

Posted: Thu Apr 21, 2016 2:21 pm
by igerasim
Hello,
replied one more time

Re: Instrumented Android APK failed (Error occurred)

Posted: Thu Apr 28, 2016 7:18 pm
by igerasim
Hello,
did you get me email? I'm waiting for FTP credentials in order to upload the APK

Re: Instrumented Android APK failed (Error occurred)

Posted: Tue May 03, 2016 5:00 pm
by Support Team
Update:
We have received the APK file, and one of our engineers is currently engaged on the issue. We will update this thread as soon as a resolution has been obtained.
Thank you,
Bassem

Re: Instrumented Android APK failed (Error occurred)

Posted: Fri Oct 20, 2017 8:27 am
by thilina
any update about the solution,
i'm also getting this in our new version of the app

Re: Instrumented Android APK failed (Error occurred)

Posted: Tue Oct 24, 2017 8:25 am
by Support Team
Hello thilina,

May I ask if you already tried the above-mentioned workaround?
Support Team wrote: Please try to remove the „1.apk“-file from the following location: “%Userprofile%\apktool\framework
After that, please try again to instrument the current version of your APK.
Please do let me know if that resolves the issue.

Sincerely,
Johannes

Re: Instrumented Android APK failed (Error occurred)

Posted: Thu Oct 26, 2017 7:53 am
by thilina
i followed all the work arounds suggested above

Re: Instrumented Android APK failed (Error occurred)

Posted: Mon Oct 30, 2017 2:12 pm
by Support Team
Hello thilina,

If you still experience the issue, please contact us directly by email ([email protected]). Furthermore, please include detailed information about the current version of Ranorex and Android. It would also be very helpful if you could send us the corresponding apk file.

We look forward to hearing from you.

Sincerely,
Johannes