microsoftconnect / intune-app-wrapping-tool-android

Use the Intune App Wrapping Tool for Android to enable Android apps to be managed by Microsoft Intune
28 stars 11 forks source link

Wrapping Error: "Failed to load app resource table." due to "error: failed to read PNG signature: file does not start with PNG signature" #59

Closed kaushalkishore1 closed 2 years ago

kaushalkishore1 commented 2 years ago

Intune_Wrapper_logs.txt

I have tried to wrap Android released as well as unsigned apk & aab file getting getting error as "Failed to load app resource table." please share the alternative approach for for INTUNE Wrapping.

meghandaly commented 2 years ago

@kaushalkishore1 According to the logs, the PNG images employee360.png and vaccinate.png could not be parsed correctly, which caused the app wrapping to fail to load the app resource table, see

C:\Users\a792334\AppData\Local\Temp\IntuneAppWrappingTool-1132339955973697324\sourceApk\res\drawable-xxxhdpi\vaccinate.png: error: failed to read PNG signature: file does not start with PNG signature.
C:\Users\a792334\AppData\Local\Temp\IntuneAppWrappingTool-1132339955973697324\sourceApk\res\drawable-xxxhdpi\vaccinate.png: error: file failed to compile.
Failed to package app.
        com.microsoft.intune.mam.apppackager.utils.AppPackagerException: Failed to load app resource table.
                com.microsoft.intune.mam.apppackager.utils.ResourceUtils.loadResourceTable(ResourceUtils.java:165)
                com.microsoft.intune.mam.apppackager.utils.ResourceUtils.mergeResources(ResourceUtils.java:104)
                com.microsoft.intune.mam.apppackager.WrapperAgent.wrapResources(WrapperAgent.java:184)
                com.microsoft.intune.mam.apppackager.AbstractWrapperAgent.wrap(AbstractWrapperAgent.java:66)
                com.microsoft.intune.mam.apppackager.AppPackager.packageApp(AppPackager.java:85)
                com.microsoft.intune.mam.apppackager.PackagerMain.mainInternal(PackagerMain.java:231)
                com.microsoft.intune.mam.apppackager.PackagerMain.main(PackagerMain.java:58)

By chance were these PNG files originally JPGs that were renamed? If so, and they were renamed, but not converted, this could account for this error (Failed to read PNG signature: file does not start with PNG signature).

Properly converting the JPGs to PNGs and then wrapping your app should resolve the issue.

meghandaly commented 2 years ago

Further investigation indicates the PNG files are indeed corrupted.

The App Wrapper relies on the Apktool, which is designed to error out when given a bad PNG image, see Issue 2202 for the Apktool for more information.

As mentioned initially, properly converting the JPGs to PNGs and then wrapping your app should resolve the issue.

meghandaly commented 2 years ago

If the above proposed resolution does not resolve your issue, please reopen the issue and provide additional details and updated logs.