Skip to content

Wrong AndroidManifest.xml packaged to the APK while using binding library #4804

@olegtyshcneko

Description

@olegtyshcneko

Steps to Reproduce

  1. Create blank android project
  2. Create binding library, add jar with androidmanifest.xml in it (in our case it is gigya android sdk aar file)
  3. Build project
  4. Try to deploy to the device the apk

Expected Behavior

Deployment of the APK to the device is the successful

Actual Behavior

Error happens
Failed to parse APK info: failed to parse AndroidManifest.xml, error: %!s()
deploy failed, error: failed to get apk infos, output: W/ResourceType( 5266): Bad XML block: header size 28024 or total size 1702240364 is larger than data size 570
ERROR: AndroidManifest.xml is corrupt, error: exit status 1

Additional info

When APK is opened - it contains wrong AndroidManifest.xml file, it copies it from gigya binding aar in our case.
When project is built with /v:d option we can see following inside
Adding AndroidManifest.xml as the archive file is out of date.
This error doesn't happen on the older version of xamarin android build tools.
Presumably it happened after commit 1c4727c(Dean Ellis) Allow BuildApk incrementally, because before that there was a check in BuildTask.cs on line 190:
if (apk.Archive.Any (e=> e.FullName == path))
and now there is no such check.

Version Information

=== Visual Studio Community 2019 for Mac (Preview) ===

Version 8.7 Preview (8.7 build 1077)
Installation UUID: d5f9f469-b751-4def-b628-74d658efb1bd
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000074

=== Mono Framework MDK ===

Runtime:
Mono 6.12.0.74 (2020-02/e9d3af508e4) (64-bit)
Package version: 612000074

=== Roslyn (Language Service) ===

3.7.0-2.20264.2+0f7f7354f2624cc089dca14b3b1c32ee46ce1349

=== NuGet ===

Version: 5.6.0.6591

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.300/Sdks
SDK Versions:
3.1.300
3.1.202
3.1.200
3.1.102
3.1.101
3.1.100
3.1.100-preview3-014645
3.0.100
3.0.100-rc1-014190
3.0.100-preview9-014004
3.0.100-preview5-011568
3.0.100-preview-010184
2.2.203
2.1.505
2.1.504
2.1.503
2.1.500
2.1.302
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.1.4
3.1.2
3.1.1
3.1.0
3.1.0-preview3.19553.2
3.0.0
3.0.0-rc1-19456-20
3.0.0-preview9-19423-09
3.0.0-preview5-27626-15
3.0.0-preview-27324-5
2.2.4
2.1.18
2.1.17
2.1.16
2.1.15
2.1.14
2.1.13
2.1.9
2.1.8
2.1.7
2.1.6
2.1.2

=== Xamarin.Profiler ===

Version: 1.6.13.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.4.1 (16137)
Build 11E503a

=== Xamarin Designer ===

Version: 16.7.0.370
Hash: d0db7acb1
Branch: remotes/origin/d16-7
Build date: 2020-05-21 04:20:32 UTC

=== Xamarin.Android ===

Version: 10.3.99.259 (Visual Studio Community)
Commit: xamarin-android/d16-7/feabf52
Android SDK: /Users/maxgrig/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.6
SDK Build Tools Version: 29.0.2

Build Information:
Mono: 075c3f0
Java.Interop: xamarin/java.interop/d16-7@d6024f1
ProGuard: Guardsquare/proguard@ebe9000
SQLite: xamarin/sqlite@49232bc
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@23c4fe0

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/maxgrig/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Android SDK Manager ===

Version: 16.6.0.56
Hash: c4cd6b3
Branch: remotes/origin/dev/joj/167bumpremote~4
Build date: 2020-05-15 22:03:24 UTC

=== Android Device Manager ===

Version: 16.6.0.115
Hash: 15b9321
Branch: remotes/origin/dev/joj/bumps~3
Build date: 2020-05-15 22:03:44 UTC

=== Xamarin.Mac ===

Version: 6.20.0.22 (Visual Studio Community)
Hash: c2a220d84
Branch: d16-7
Build date: 2020-05-15 10:07:49-0400

=== Xamarin.iOS ===

Version: 13.20.0.22 (Visual Studio Community)
Hash: c2a220d84
Branch: d16-7
Build date: 2020-05-15 10:07:50-0400

=== Build Information ===

Release ID: 807001077
Git revision: 15d775b6ec2cb55ce769a73c8d9dcf6ed58b7e35
Build date: 2020-05-21 12:10:28-04
Build branch: release-8.7
Xamarin extensions: 15d775b6ec2cb55ce769a73c8d9dcf6ed58b7e35

=== Operating System ===

Mac OS X 10.15.2
Darwin 19.2.0 Darwin Kernel Version 19.2.0
Sat Nov 9 03:47:04 PST 2019
root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.need-infoIssues that need more information from the author.regression

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions