Instrumented Android APK failed (Error occurred)

Ranorex Studio, Spy, Recorder, and Driver.
igerasim
Posts: 5
Joined: Mon Apr 18, 2016 4:05 pm

Instrumented Android APK failed (Error occurred)

Post by igerasim » Mon Apr 18, 2016 4:20 pm

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)

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Instrumented Android APK failed (Error occurred)

Post by Support Team » Tue Apr 19, 2016 9:21 am

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

igerasim
Posts: 5
Joined: Mon Apr 18, 2016 4:05 pm

Re: Instrumented Android APK failed (Error occurred)

Post by igerasim » Wed Apr 20, 2016 2:44 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Instrumented Android APK failed (Error occurred)

Post by Support Team » Wed Apr 20, 2016 1:44 pm

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

igerasim
Posts: 5
Joined: Mon Apr 18, 2016 4:05 pm

Re: Instrumented Android APK failed (Error occurred)

Post by igerasim » Wed Apr 20, 2016 2:25 pm

Hello,
I send you apk file to provided email

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Instrumented Android APK failed (Error occurred)

Post by Support Team » Thu Apr 21, 2016 9:41 am

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

igerasim
Posts: 5
Joined: Mon Apr 18, 2016 4:05 pm

Re: Instrumented Android APK failed (Error occurred)

Post by igerasim » Thu Apr 21, 2016 2:21 pm

Hello,
replied one more time

igerasim
Posts: 5
Joined: Mon Apr 18, 2016 4:05 pm

Re: Instrumented Android APK failed (Error occurred)

Post by igerasim » Thu Apr 28, 2016 7:18 pm

Hello,
did you get me email? I'm waiting for FTP credentials in order to upload the APK

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Instrumented Android APK failed (Error occurred)

Post by Support Team » Tue May 03, 2016 5:00 pm

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

thilina
Posts: 28
Joined: Wed Sep 03, 2014 12:32 pm

Re: Instrumented Android APK failed (Error occurred)

Post by thilina » Fri Oct 20, 2017 8:27 am

any update about the solution,
i'm also getting this in our new version of the app

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Instrumented Android APK failed (Error occurred)

Post by Support Team » Tue Oct 24, 2017 8:25 am

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

thilina
Posts: 28
Joined: Wed Sep 03, 2014 12:32 pm

Re: Instrumented Android APK failed (Error occurred)

Post by thilina » Thu Oct 26, 2017 7:53 am

i followed all the work arounds suggested above

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Instrumented Android APK failed (Error occurred)

Post by Support Team » Mon Oct 30, 2017 2:12 pm

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