Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Context: https://github.com/google/bundletool/releases/tag/1.15.1
Changes: google/bundletool@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
989dc07.

* [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 `<application>` element,
causing the latest version of `bundletool` to error with:

    BT One element <application> was expected, but none were found.

To solve this, let's update the test to not overwrite any existing XML content.
  • Loading branch information
jonathanpeppers authored Jun 22, 2023
1 parent ad95b98 commit 6e375d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
<XAPlatformToolsPackagePrefix Condition=" '$(HostOS)' == 'Darwin' "></XAPlatformToolsPackagePrefix>
<XAPlatformToolsVersion>34.0.1</XAPlatformToolsVersion>
<XAIncludeProprietaryBits Condition="'$(XAIncludeProprietaryBits)' == ''">False</XAIncludeProprietaryBits>
<XABundleToolVersion Condition="'$(XABundleToolVersion)' == ''">1.8.1</XABundleToolVersion>
<XABundleToolVersion Condition="'$(XABundleToolVersion)' == ''">1.15.1</XABundleToolVersion>
<XAPackagesDir Condition=" '$(XAPackagesDir)' == '' And '$(NUGET_PACKAGES)' != ''">$(NUGET_PACKAGES)</XAPackagesDir>
<XAPackagesDir Condition=" '$(XAPackagesDir)' == '' And '$(HostOS)' == 'Windows'">$(userprofile)\.nuget\packages</XAPackagesDir>
<XAPackagesDir Condition=" '$(XAPackagesDir)' == '' And '$(HostOS)' != 'Windows'">$(HOME)/.nuget/packages</XAPackagesDir>
Expand Down
8 changes: 0 additions & 8 deletions Documentation/release-notes/bundletool-1.8.1.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,16 @@ public void ModifyManifest ([Values (true, false)] bool isRelease)
<_Permissions Include=""&lt;uses-permission android:name=&quot;android.permission.READ_CONTACTS&quot; /&gt;"" />
</ItemGroup>
<Target Name=""_Foo"">
<XmlPeek Query=""/manifest/*"" XmlInputPath=""$(IntermediateOutputPath)android\AndroidManifest.xml"">
<Output TaskParameter=""Result"" ItemName=""_XmlNodes"" />
</XmlPeek>
<PropertyGroup>
<_ExistingXml>@(_XmlNodes, ' ')</_ExistingXml>
<_NewXml>@(_Permissions, ' ')</_NewXml>
</PropertyGroup>
<XmlPoke
XmlInputPath=""$(IntermediateOutputPath)android\AndroidManifest.xml""
Value=""@(_Permissions)""
Value=""$(_ExistingXml)$(_NewXml)""
Query=""/manifest""
Namespaces=""$(Namespace)""
/>
Expand Down

0 comments on commit 6e375d5

Please sign in to comment.