Repository navigation
Rando ANDZA0000: Unable to open app.apk as a zip archive #6067
Copy link
Copy link
Closed
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.bugComponent does not function as intended.Component does not function as intended.
Milestone
Description
Activity
- addedArea: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.needs-triageIssues that need to be assigned.Issues that need to be assigned.
on Jul 1, 2021 Other ways to diagnose:
$ unzip -t com.xamarin.debuggerattribute.apk Archive: com.xamarin.debuggerattribute.apk testing: AndroidManifest.xml OK testing: res/drawable-mdpi-v4/icon.png OK testing: res/drawable-hdpi-v4/icon.png OK testing: res/drawable-xhdpi-v4/icon.png OK testing: res/drawable-xxhdpi-v4/icon.png OK testing: res/drawable-xxxhdpi-v4/icon.png OK testing: res/layout/main.xml OK testing: resources.arsc OK file #9: bad zipfile offset (local header sig): 51032 testing: lib/arm64-v8a/libxamarin-app.so OK testing: lib/x86/libxamarin-app.so OK testing: lib/arm64-v8a/libSystem.IO.Compression.Native.so OK testing: lib/arm64-v8a/libSystem.Native.so OK testing: lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so OK testing: lib/arm64-v8a/libmonosgen-2.0.so OK testing: lib/arm64-v8a/libmonodroid.so OK testing: lib/arm64-v8a/libxamarin-debug-app-helper.so OK testing: lib/x86/libSystem.IO.Compression.Native.so OK testing: lib/x86/libSystem.Native.so OK testing: lib/x86/libSystem.Security.Cryptography.Native.Android.so OK testing: lib/x86/libmonosgen-2.0.so OK testing: lib/x86/libmonodroid.so OK testing: lib/x86/libxamarin-debug-app-helper.so OK At least one error was detected in com.xamarin.debuggerattribute.apk.unzip -tdoesn't give name of the broken entry, alas.zipinfo -vvshows us there are extra bytes precedingclasses.dex(or following the previous entry,resources.arsc. @dellis1972 notes that the broken entry follows data we add to the apk by copying it from another zip archive creted byaapt2Central directory entry #9: --------------------------- There are an extra 2 bytes preceding this file. classes.dex offset of local header from start of archive: 51032 (000000000000C758h) bytes file system or operating system of origin: Unix version of encoding software: 6.3 minimum file system compatibility required: MS-DOS, OS/2 or NT FAT minimum software version required to extract: 2.0 compression method: deflated compression sub-type (deflation): maximum file security status: not encrypted extended local header: no file last modified on (DOS date/time): 2021 Jul 1 08:50:32 32-bit CRC value (hex): ec5ca9fd compressed size: 72278 bytes uncompressed size: 317776 bytes length of filename: 11 characters length of extra field: 0 bytes length of file comment: 0 characters disk number on which file begins: disk 1 apparent file type: binary Unix file attributes (100644 octal): -rw-r--r-- MS-DOS file attributes (00 hex): none There is no file comment. Central directory entry #10: --------------------------- There are an extra 9 bytes preceding this file. lib/arm64-v8a/libxamarin-app.so
- removedneeds-triageIssues that need to be assigned.Issues that need to be assigned.
on Jul 1, 2021 We have another apparent instance of this bug: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=4979360&view=ms.vss-test-web.build-test-results-tab&runId=23547392&resultId=100040&paneView=attachments
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2320,2): error ANDZA0000: Unable to open '…/CheckOldResourceDesignerWithWrongCasingIsRemoved(False)/obj/Debug/android/bin/com.xamarin.checkoldresourcedesignerwithwrongcasingisremoved.apk' as zip archive- added a commit that references this issue
on Aug 5, 2021 - addedbugComponent does not function as intended.Component does not function as intended.
on Sep 6, 2022 - added a commit that references this issue
on Feb 28, 2023 We think (hope? pray?) that this was fixed by PR #7759.
- ghost locked as resolved and limited conversation to collaborators
on Apr 27, 2023
Metadata
Metadata
Assignees
Labels
Area: App+Library BuildIssues when building Library projects or Application projects.Issues when building Library projects or Application projects.bugComponent does not function as intended.Component does not function as intended.
It's our favorite, hysenbugs!
There is no repro!
Context:
Sometimes, the
DebuggerAttribute"Full", False, True)unit test (and others?) will fail:The cause of the error is that
zipaligndoesn't like the file:The file does exist; it is attached here as com.xamarin.debuggerattribute.zip.
Aside:
zipalignsource: https://android.googlesource.com/platform/build.git/+/refs/heads/master/tools/zipalign/Lots of spitballing and investigation later, and we we see that
zipdetails -vvdoesn't like it:It appears that either the
resources.arscentry, or the followingclasses.dexentry, is somehow broken;7zipreports:Something isn't kosher here.
@grendello eventually concludes:
It looks like this is due to something we're doing, but we're not sure what, why, or how to fix it.