Skip to content

Tags: dotnet/android

Tags

36.0.0-preview.6.169

Toggle 36.0.0-preview.6.169's commit message
[xabt] fall back to libZipSharp on .NET framework (#10238)

Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2510554

In testing .NET 10, we found the issue:

    ADB0010: Mono.AndroidTools.InstallFailedException: Unexpected install
    output: Failure [-124: Failed parse during installPackageLI: Targeting
    R+ (version 30 and above) requires the resources.arsc of installed
    APKs to be stored uncompressed and aligned on a 4-byte boundary] ...

1. Create a new .NET MAUI/MAUI Blazor app.
2. Change the value for the Color attribute to #FF0000 or any color.
```xml
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#FF0000" BaseSize="128,128" />
```
3. Deploy to android.
4. The splash screen color should change according to the chosen color.
5. Stop Debugging and change the splash screen color again.
6. If you do it enough times, you would encounter the error.

Manually, adding `$(_AndroidUseLibZipSharp)` to the `.csproj` file
solves the issue:

    <_AndroidUseLibZipSharp>true</_AndroidUseLibZipSharp>

Reviewing, a `.binlog` created by setting `%MSBUILDDEBUGENGINE%=1` and
launching Visual Studio, we see the message:

    Task BuildArchive
    ...
    Using System.IO.Compression because no uncompressed file extensions were specified.

So, we are relying on .NET Framework's `System.IO.Compression` to
handle `.apk` creation in some cases. `libZipSharp` *was created*
because of bugs in .NET Framework's & Mono's implementation of
`System.IO.Compression` that caused issues with Android packaging.

To fix this, we will always use `libZipSharp` for .NET Framework,
regardless if files are compressed or not.

35.0.78

Toggle 35.0.78's commit message
[ci] Use templates from DevDiv/Xamarin.yaml-templates (#10012)

Updates the repo reference that provides common yaml templates from

  * https://github.com/xamarin/yaml-templates

to

  * https://devdiv.visualstudio.com/DevDiv/_git/Xamarin.yaml-templates

36.0.0-preview.5.116

Toggle 36.0.0-preview.5.116's commit message
[xabt] rename `$(EnableProfiler)` to `$(EnableDiagnostics)` (#10166)

Context: dotnet/macios#22982
Context: dotnet/runtime#115473 (comment)

We are aligning WASM, iOS, Android to all use the same property name for this.

36.0.0-preview.4.80

Toggle 36.0.0-preview.4.80's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump to dotnet/dotnet@0f7a4879bc 10.0.100-preview.4.25255.103 (#10115)

Changes: dotnet/dotnet@1abd362...0f7a487

Updates:

* Microsoft.DotNet.Build.Tasks.Feed: from 10.0.0-beta.25252.106 to 10.0.0-beta.25255.103
* Microsoft.DotNet.Cecil: from 0.11.5-alpha.25252.106 to 0.11.5-alpha.25255.103
* Microsoft.NET.ILLink.Tasks: from 10.0.0-preview.4.25252.106 to 10.0.0-preview.4.25255.103
* Microsoft.NET.Sdk: from 10.0.100-preview.4.25252.106 to 10.0.100-preview.4.25255.103
* Microsoft.NETCore.App.Ref: from 10.0.0-preview.4.25252.106 to 10.0.0-preview.4.25255.103
* Microsoft.TemplateEngine.Authoring.Tasks: from 10.0.100-preview.4.25252.106 to 10.0.100-preview.4.25255.103

36.0.0-preview.3.22

Toggle 36.0.0-preview.3.22's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
[release/10.0.1xx-preview3] [Mono.Android] prefix `Microsoft.Android.…

…Runtime` namespace with `_` (#9998)

Context: b217dca

We introduced a new `internal` type in `Mono.Android.dll`:

	namespace Microsoft.Android.Runtime;

	class ManagedValueManager : JniRuntime.JniValueManager

Causes various C# compiler errors in dotnet/maui:

	D:\src\maui\src\Essentials\src\AppActions\AppActions.shared.cs(62,28):
	error CS0234: The type or namespace name 'Content' does not exist in the namespace 'Microsoft.Android' (are you missing an assembly reference?)

To fix this, prefix the namespace with `_`.  We basically can never
introduce a `Microsoft.Android.*` namespace in `Mono.Android.dll`
without potentially breaking MAUI.

35.0.61

Toggle 35.0.61's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump to 82d8938c 34.0.154 (#9958)

Changes: fea9dcd...82d8938

* Bump to dotnet/android-tools@5612c1a2

34.0.154

Toggle 34.0.154's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump to dotnet/android-tools@5612c1a2 (#9949)

Changes: dotnet/android-tools@f53106a...5612c1a

  * dotnet/android-tools@5612c1a: [Xamarin.Android.Tools.AndroidSdk] OS-specific dirs are OS-specific (dotnet/android-tools#250)
  * dotnet/android-tools@da87185: [Xamarin.Android.Tools.AndroidSdk] Remove hardcoded Path (dotnet/android-tools#248)

35.99.0-preview.2.205

Toggle 35.99.0-preview.2.205's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump to dotnet/sdk@f839338ddc 10.0.100-preview.2.25157.5 (#9896)

Changes: dotnet/sdk@c172dd3...f839338
Changes: dotnet/runtime@143f7e2...07b0519

Updates:

* Microsoft.NET.Sdk: from 10.0.100-preview.2.25155.11 to 10.0.100-preview.2.25157.5
* Microsoft.NETCore.App.Ref: from 10.0.0-preview.2.25125.14 to 10.0.0-preview.2.25156.1
* Microsoft.NET.ILLink.Tasks: from 10.0.0-preview.2.25125.14 to 10.0.0-preview.2.25156.1

35.99.0-preview.1.140

Toggle 35.99.0-preview.1.140's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Bump to dotnet/sdk@e1a2886f56 10.0.100-preview.1.25106.28 (#9762)

Changes: dotnet/sdk@18f7c61...e1a2886

Updates: Microsoft.NET.Sdk: from 10.0.100-preview.1.25104.22 to 10.0.100-preview.1.25106.28

Other changes:

Pass `--azure-feed https://ci.dot.net/public` to `dotnet-install` scripts to avoid the error:

    Step Xamarin.Android.Prepare.Step_InstallDotNetPreview failed: Failed to download https://builds.dotnet.microsoft.com/dotnet/Sdk/10.0.100-preview.1.25105.26/dotnet-sdk-10.0.100-preview.1.25105.26-osx-arm64.tar.gz

The `builds.dotnet.microsoft.com` domain does not appear to work.

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>

35.0.50

Toggle 35.0.50's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
[XABT] Fix ApplicationAttribute.ManageSpaceActivity manual mapping (#…

…9708) (#9729)

Fixes: #9705

Context: 3ab74db

When converting `AndroidManifest.xml` attribute mappings in 3ab74db,
`ApplicationAttribute.ManageSpaceActivity` was not correctly mapped
in the manual mapping.

The result is that if the property is used:

	[assembly: Application(ManageSpaceActivity=typeof(MyManageSpaceActivity))]

the build will fail:

	error XAGJS7007: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Type'.
	error XAGJS7007:    at Android.App.ApplicationAttribute.<>c.<AddManualMapping>b__189_3(ApplicationAttribute self, Object value) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Mono.Android/ApplicationAttribute.Partial.cs:line 47
	error XAGJS7007:    at Xamarin.Android.Manifest.ManifestDocumentElement`1.Load(T value, CustomAttribute attribute, TypeDefinitionCache cache) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocumentElement.cs:line 127
	error XAGJS7007:    at Android.App.ApplicationAttribute.FromCustomAttributeProvider(ICustomAttributeProvider provider, TypeDefinitionCache cache) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Mono.Android/ApplicationAttribute.Partial.cs:line 67
	error XAGJS7007:    at Xamarin.Android.Tasks.ManifestDocument.CreateApplicationElement(XElement manifest, String applicationClass, List`1 subclasses, TypeDefinitionCache cache) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocument.cs:line 581
	error XAGJS7007:    at Xamarin.Android.Tasks.ManifestDocument.Merge(TaskLoggingHelper log, TypeDefinitionCache cache, List`1 subclasses, String applicationClass, Boolean embed, String bundledWearApplicationName, IEnumerable`1 mergedManifestDocuments) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Utilities/ManifestDocument.cs:line 290
	error XAGJS7007:    at Xamarin.Android.Tasks.GenerateJavaStubs.MergeManifest(NativeCodeGenState codeGenState, Dictionary`2 userAssemblies) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 363
	error XAGJS7007:    at Xamarin.Android.Tasks.GenerateJavaStubs.Run(Boolean useMarshalMethods) in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 270
	error XAGJS7007:    at Xamarin.Android.Tasks.GenerateJavaStubs.RunTask() in /Users/runner/work/1/s/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs:line 102
	error XAGJS7007:    at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 25

`ApplicationAttribute.ManageSpaceActivity` needs to follow the
pattern other attributes of type `Type` follow, like
`ActivityAttribute.ParentActivity`:

	mapping.Add (
		member: "ParentActivity",
		attributeName: "parentActivityName",
		getter: self => self._ParentActivity,
		setter: (self, value) => self._ParentActivity = (string) value,
		typeof (Type)
	);

With this change, the reported case in #9705 generates the proper
`AndroidManifest` value:

	<application android:manageSpaceActivity="crc64fe9411caa440e724.MyManageSpaceActivity" … >

Co-authored-by: Jonathan Pobst <jonathan.pobst@microsoft.com>