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

Failed to load app resource table - Target Android 28 #32

Closed AiswaryaSam closed 4 years ago

AiswaryaSam commented 5 years ago

Trying to wrap my android apk buy unable to wrap the app due to the error "Failed to load app resource table". warnings refer to android-28 resources

LOGS:

WRN C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res\values\arrays.xml:424: error: invalid value for type 'array'. Expected a reference. WRN C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res\values\arrays.xml:425: error: invalid value for type 'array'. Expected a reference. WRN C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res\values\public.xml:1977: error: resource 'drawable/$avd_hide_password0' has invalid entry name '$avd_hide_password0'. Invalid character '$avd_hide_password0'. WRN C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res\values\public.xml:1978: error: resource 'drawable/$avd_hide_password1' has invalid entry name '$avd_hide_password1'. Invalid character '$avd_hide_password1'. WRN C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res\values\public.xml:1979: error: resource 'drawable/$avd_hide_password2' has invalid entry name '$avd_hide_password2'. Invalid character '$avd_hide_password2'. WRN C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res\values\public.xml:1980: error: resource 'drawable/$avd_show_password0' has invalid entry name '$avd_show_password0'. Invalid character '$avd_show_password0'. WRN C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res\values\public.xml:1981: error: resource 'drawable/$avd_show_password1' has invalid entry name '$avd_show_password1'. Invalid character '$avd_show_password1'. WRN C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res\values\public.xml:1982: error: resource 'drawable/$avd_show_password2' has invalid entry name '$avd_show_password2'. Invalid character '$avd_show_password2'. DBG [Res][End] Merging app resources. DBG [WrapperAgent][End] Updating app resources. ERR 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:147) com.microsoft.intune.mam.apppackager.utils.ResourceUtils.mergeResources(ResourceUtils.java:97) com.microsoft.intune.mam.apppackager.WrapperAgent.wrapResources(WrapperAgent.java:145) com.microsoft.intune.mam.apppackager.AbstractWrapperAgent.wrap(AbstractWrapperAgent.java:66) com.microsoft.intune.mam.apppackager.AppPackager.packageApp(AppPackager.java:117) com.microsoft.intune.mam.apppackager.PackagerMain.mainInternal(PackagerMain.java:220) com.microsoft.intune.mam.apppackager.PackagerMain.main(PackagerMain.java:58) brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\choochor\AppData\Local\Temp\brut_util_Jar_7674405416477692323.tmp, compile, --dir, C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res, --legacy, -o, C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\build\resources.zip] brut.androlib.Androlib.buildResourcesFull(Androlib.java:503) com.microsoft.intune.mam.apppackager.utils.ResourceUtils.loadResourceTable(ResourceUtils.java:142) com.microsoft.intune.mam.apppackager.utils.ResourceUtils.mergeResources(ResourceUtils.java:97) com.microsoft.intune.mam.apppackager.WrapperAgent.wrapResources(WrapperAgent.java:145) com.microsoft.intune.mam.apppackager.AbstractWrapperAgent.wrap(AbstractWrapperAgent.java:66) com.microsoft.intune.mam.apppackager.AppPackager.packageApp(AppPackager.java:117) com.microsoft.intune.mam.apppackager.PackagerMain.mainInternal(PackagerMain.java:220) com.microsoft.intune.mam.apppackager.PackagerMain.main(PackagerMain.java:58) brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\choochor\AppData\Local\Temp\brut_util_Jar_7674405416477692323.tmp, compile, --dir, C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res, --legacy, -o, C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\build\resources.zip] brut.androlib.res.AndrolibResources.aapt2Package(AndrolibResources.java:362) brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:601) brut.androlib.Androlib.buildResourcesFull(Androlib.java:481) com.microsoft.intune.mam.apppackager.utils.ResourceUtils.loadResourceTable(ResourceUtils.java:142) com.microsoft.intune.mam.apppackager.utils.ResourceUtils.mergeResources(ResourceUtils.java:97) com.microsoft.intune.mam.apppackager.WrapperAgent.wrapResources(WrapperAgent.java:145) com.microsoft.intune.mam.apppackager.AbstractWrapperAgent.wrap(AbstractWrapperAgent.java:66) com.microsoft.intune.mam.apppackager.AppPackager.packageApp(AppPackager.java:117) com.microsoft.intune.mam.apppackager.PackagerMain.mainInternal(PackagerMain.java:220) com.microsoft.intune.mam.apppackager.PackagerMain.main(PackagerMain.java:58) brut.common.BrutException: could not exec (exit code = 1): [C:\Users\choochor\AppData\Local\Temp\brut_util_Jar_7674405416477692323.tmp, compile, --dir, C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\res, --legacy, -o, C:\Users\choochor\AppData\Local\Temp\IntuneAppWrappingTool-1899227211941751832\sourceApk\build\resources.zip] brut.util.OS.exec(OS.java:98) brut.androlib.res.AndrolibResources.aapt2Package(AndrolibResources.java:358) brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:601) brut.androlib.Androlib.buildResourcesFull(Androlib.java:481) com.microsoft.intune.mam.apppackager.utils.ResourceUtils.loadResourceTable(ResourceUtils.java:142) com.microsoft.intune.mam.apppackager.utils.ResourceUtils.mergeResources(ResourceUtils.java:97) com.microsoft.intune.mam.apppackager.WrapperAgent.wrapResources(WrapperAgent.java:145) com.microsoft.intune.mam.apppackager.AbstractWrapperAgent.wrap(AbstractWrapperAgent.java:66) com.microsoft.intune.mam.apppackager.AppPackager.packageApp(AppPackager.java:117) com.microsoft.intune.mam.apppackager.PackagerMain.mainInternal(PackagerMain.java:220) com.microsoft.intune.mam.apppackager.PackagerMain.main(PackagerMain.java:58) ERR Failed to load app resource table.

Intune app wrapping tool (please complete the following information):

Additional context: All the resources referred are inside Android SDK-28

rygo-msft commented 5 years ago

Hi @AiswaryaSam can you please attach the full log file. There should be a message at the end of wrapping that describes the log file location. It should look like Verbose logs can be found at:

Also, do you know what the build tools version your app is built with? Is the compile SDK also 28?

AiswaryaSam commented 5 years ago

Hi @rygo-msft, the compile SDK version is 28 and the build tools version is 28.0.3.

Here is the full logs: log.txt

Please let me know if you need any other information. Thanks!

rygo-msft commented 5 years ago

From what I can tell the issue is coming from an array resource (or a resource incorrectly decompiled as an array type) error: invalid value for type 'array'. Expected a reference.

@AiswaryaSam, I haven't been able to reproduce this locally as it is likely either app specific or specific to a particular library included in the app.

Would you be able to share the full list of dependencies included in the app (including the versions). Even better would be if you could share an apk that reproduces the issue. You likely could make a stub app project with just the dependency references in this case.

AiswaryaSam commented 5 years ago

Hi @rygo-msft, As the log refers to arrays.xml, I could only find the below references for arrays.xml in my project and it refers to android 28 platform. references Screen Shot 2019-06-22 at 9 01 40 AM

As suggested, I shall try the stub project as well and let you know. Thank You!

rygo-msft commented 4 years ago

Hi @AiswaryaSam, are you still seeing this issue? Did you have any luck creating a sample app that reproduces the issue?

AiswaryaSam commented 4 years ago

Hi @rygo-msft , the issue was resolved after resolving removing missing string-array resources in default strings file