From e2b763c790b538b92d49df532c027a7fa3980084 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 20 Jun 2023 08:31:05 -0500 Subject: [PATCH 1/5] Bump to google/bundletool/main@f17ce94a Context: https://github.com/google/bundletool/releases/tag/1.15.1 Changes: https://github.com/google/bundletool/compare/1.8.1...1.15.1 We are seeing an error with API 34: XABBA7024: Xamarin.Tools.Zip.ZipIOException: The file 'obj\Release\android\bin\base.zip' is not a ZIP archive. We wonder if updating `bundletool` will help. It was last updated in 989dc07b. --- Configuration.props | 2 +- Documentation/release-notes/bundletool-1.8.1.md | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 Documentation/release-notes/bundletool-1.8.1.md diff --git a/Configuration.props b/Configuration.props index a73e81fc9ac..9c4bafcf0da 100644 --- a/Configuration.props +++ b/Configuration.props @@ -148,7 +148,7 @@ 34.0.1 False - 1.8.1 + 1.15.1 $(userprofile)\.nuget\packages $(HOME)/.nuget/packages $([System.IO.Path]::PathSeparator) diff --git a/Documentation/release-notes/bundletool-1.8.1.md b/Documentation/release-notes/bundletool-1.8.1.md deleted file mode 100644 index b295ef52f6a..00000000000 --- a/Documentation/release-notes/bundletool-1.8.1.md +++ /dev/null @@ -1,8 +0,0 @@ -### bundletool version update to 1.8.1 - -The version of the [`bundletool`][bundletool] executable included in -Xamarin.Android has been updated from 1.4.0 to [1.8.1][bundletool-1.8.1], -bringing in several improvements and bug fixes. - -[bundletool]: https://developer.android.com/studio/command-line/bundletool -[bundletool-1.8.1]: https://github.com/google/bundletool/releases/tag/1.8.1 \ No newline at end of file From 43fe871efbecced987151ad2a80cc4dc07872a03 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 20 Jun 2023 15:33:29 -0500 Subject: [PATCH 2/5] [tests] Update `ManifestTest.cs` Context: https://github.com/xamarin/xamarin-android/blob/f1d59181c8daaa8d2abcdfd151b592ece49155ca/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs#L650-L651 The `ModifyManifest` test actually writes "too much" to the `AndroidManifest.xml` file, removing the `` element, causing the latest version of `bundletool` to error with: BT One element was expected, but none were found. To solve this, let's just set `application:versionCode` in the test instead. --- .../Tests/Xamarin.Android.Build.Tests/ManifestTest.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs index 7642eeabe6b..99bda141b4e 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs @@ -665,14 +665,11 @@ public void ModifyManifest ([Values (true, false)] bool isRelease) - - <_Permissions Include=""<uses-permission android:name="android.permission.READ_CONTACTS" />"" /> - @@ -684,7 +681,7 @@ public void ModifyManifest ([Values (true, false)] bool isRelease) using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) { Assert.IsTrue (builder.Build (proj), "Build should have succeeded"); var manifest = builder.Output.GetIntermediaryAsText (Root, Path.Combine ("android", "AndroidManifest.xml")); - Assert.IsTrue (manifest.Contains ("READ_CONTACTS"), $"Manifest should contain the READ_CONTACTS"); + Assert.IsTrue (manifest.Contains ("12345"), $"Manifest should contain versionCode=12345"); } } From f9e4f86725ae59a40c5f198be70f1d8a621e44f7 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Wed, 21 Jun 2023 14:57:36 -0500 Subject: [PATCH 3/5] Revert "[tests] Update `ManifestTest.cs`" This reverts commit 43fe871efbecced987151ad2a80cc4dc07872a03. --- .../Tests/Xamarin.Android.Build.Tests/ManifestTest.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs index 99bda141b4e..7642eeabe6b 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs @@ -665,11 +665,14 @@ public void ModifyManifest ([Values (true, false)] bool isRelease) + + <_Permissions Include=""<uses-permission android:name="android.permission.READ_CONTACTS" />"" /> + @@ -681,7 +684,7 @@ public void ModifyManifest ([Values (true, false)] bool isRelease) using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) { Assert.IsTrue (builder.Build (proj), "Build should have succeeded"); var manifest = builder.Output.GetIntermediaryAsText (Root, Path.Combine ("android", "AndroidManifest.xml")); - Assert.IsTrue (manifest.Contains ("12345"), $"Manifest should contain versionCode=12345"); + Assert.IsTrue (manifest.Contains ("READ_CONTACTS"), $"Manifest should contain the READ_CONTACTS"); } } From 2e229b8c72ee2a7d3bbe37e3301b8f715f06f4fb Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Wed, 21 Jun 2023 15:03:07 -0500 Subject: [PATCH 4/5] Update ManifestTest.cs --- .../Tests/Xamarin.Android.Build.Tests/ManifestTest.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs index 7642eeabe6b..308a0ec6c4b 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs @@ -669,9 +669,12 @@ public void ModifyManifest ([Values (true, false)] bool isRelease) <_Permissions Include=""<uses-permission android:name="android.permission.READ_CONTACTS" />"" /> + + + '%(Identity)', ' ')@(_Permissions)"" Query=""/manifest"" Namespaces=""$(Namespace)"" /> From a0e0ce0b012c5694f436d0d0ecc97f675bca6ddc Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 22 Jun 2023 08:43:10 -0500 Subject: [PATCH 5/5] Update ManifestTest.cs Work around an MSBuild issue: error MSB4012: The expression "@(_XmlNodes->'%(Identity)', ' ')@(_Permissions)" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. --- .../Tests/Xamarin.Android.Build.Tests/ManifestTest.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs index 308a0ec6c4b..03088e4a2ee 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs @@ -672,9 +672,13 @@ public void ModifyManifest ([Values (true, false)] bool isRelease) + + <_ExistingXml>@(_XmlNodes, ' ') + <_NewXml>@(_Permissions, ' ') + '%(Identity)', ' ')@(_Permissions)"" + Value=""$(_ExistingXml)$(_NewXml)"" Query=""/manifest"" Namespaces=""$(Namespace)"" />